How to use the decompress.targz function in decompress

To help you get started, we’ve selected a few decompress examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github theintern / digdug / Tunnel.js View on Github external
function (response) {
					var decompressor = new Decompress();
					decompressor.src(response.data)
						.use(Decompress.zip())
						.use(Decompress.targz())
						.dest(self.directory)
						.run(function (error) {
							if (error) {
								reject(error);
							}
							else {
								resolve();
							}
						});
				},
				function (error) {
github nwjs / npm-installer / scripts / install.js View on Github external
var decompressOptions = { strip: 1, mode: '755' };
var filePath;
if( parsedUrl.protocol == 'file:' ) {
  filePath = path.resolve(
    decodeURIComponent(
      url.slice( 'file://'.length )
    )
  );
  if ( !fileExistsAndAvailable(filePath) ) logError(
    'Could not find ' + filePath
  );
  new Decompress()
    .src( filePath )
    .dest( dest )
    .use( Decompress.zip(decompressOptions) )
    .use( Decompress.targz(decompressOptions) )
    .run( cb );
} else {
  download(url, dest, merge({ extract: true }, decompressOptions))
    .then(function() {cb();})
    .catch(function(e) {cb(e);});
}
github lando / lando / modules / jxcore / scripts / install.js View on Github external
].join('/');

var dest = path.resolve(__dirname, '..', 'bin');
rimraf.sync(dest);

var parsedUrl = urlModule.parse(url);
var decompressOptions = {strip: 1, mode: '755'};
if (parsedUrl.protocol === 'file:') {
  if (fileExists(parsedUrl.path)) {
    logError('Could not find ' + parsedUrl.path);
  }
  new Decompress()
    .src(parsedUrl.path)
    .dest(dest)
    .use(Decompress.zip(decompressOptions))
    .use(Decompress.targz(decompressOptions))
    .run(cb);
} else {
  new Download(merge({extract: true}, decompressOptions))
    .get(url)
    .dest(dest)
    .run(cb);
}

decompress

Extracting archives made easy

MIT
Latest version published 5 years ago

Package Health Score

65 / 100
Full package analysis