Extracting archives made easy
See decompress-cli for the command-line version.
$ npm install --save decompress
const decompress = require('decompress');
decompress('unicorn.zip', 'dist').then(files => {
console.log('done!');
});
Returns a Promise for an array of files in the following format:
{
data: Buffer,
mode: Number,
mtime: String,
path: String,
type: String
}
Type: string
Buffer
File to decompress.
Type: string
Output directory.
Type: Function
Filter out files before extracting. E.g:
decompress('unicorn.zip', 'dist', {
filter: file => path.extname(file.path) !== '.exe'
}).then(files => {
console.log('done!');
});
Type: Function
Map files before extracting: E.g:
decompress('unicorn.zip', 'dist', {
map: file => {
file.path = `unicorn-${file.path}`;
return file;
}
}).then(files => {
console.log('done!');
});
Type: Array
Default: [decompressTar(), decompressTarbz2(), decompressTargz(), decompressUnzip()]
Array of plugins to use.
Type: number
Default: 0
Remove leading directory components from extracted files.
MIT © Kevin Mårtensson
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.