Skip to content

GlossMod/7z-win

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

7z-win

搭配 node-7z 使用

import { extractFull, Data } from 'node-7z'
import { path7za } from '7z-win'

public static unzip(source: string, target: string): Promise<Data[]> {
    return new Promise(async (resolve, reject) => {
        let files: Data[] = []
        const myStream = extractFull(source, target, {
            $bin: path7za,
            charset: 'utf-8'
        })
        myStream.on('data', function (data) {
            files.push(data)
        })
        myStream.on('error', (err) => {
            reject(err)
        })
        myStream.on('end', function () {
            resolve(files)
        })

    })
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published