How to use the unzip.Extract function in unzip

To help you get started, we’ve selected a few unzip 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 processing / p5.js-editor / gulpfile.js View on Github external
gulp.task('getOfflineReference', function(){
// get latest .zip data from p5js website and unzip it.
request('http://p5js.org/offline-reference/p5-reference.zip')
  // .pipe(fs.createWriteStream('./public/mode_assets/p5/p5-reference.zip'))
  .pipe(unzip.Extract({ path: './public/mode_assets/p5/p5-reference' }))
  .on('close', function () {
    console.log('Offline Reference Retrieved!');
  });


})
github vellengs / typerx / packages / server / dist / scripts / apigen.js View on Github external
response.data.pipe(fs.createWriteStream(local)).on('finish', (done) => {
                fs.createReadStream(local).pipe(unzip.Extract({ path: 'decompress' })).on('close', (done) => __awaiter(this, void 0, void 0, function* () {
                    // await sleep(2000);
                    console.log('extracted ...');
                    fs.unlinkSync(local);
                    console.log('deleted zip file ...');
                    yield removeFolder(generatedFolder);
                    console.log('removed generated ...');
                    // await sleep(1000);
                    fs.renameSync(templateFolder, generatedFolder);
                    console.log('copy generated ...');
                    yield removeFolder(decompress);
                    console.log('done ...');
                }));
            });
        }
github vellengs / typerx / packages / server / src / scripts / apigen.ts View on Github external
response.data.pipe(fs.createWriteStream(local)).on('finish', (done: any) => {
            fs.createReadStream(local).pipe(unzip.Extract({ path: 'decompress' })).on('close',
                async (done: any) => {
                    // await sleep(2000);
                    console.log('extracted ...');
                    fs.unlinkSync(local);
                    console.log('deleted zip file ...');
                    await removeFolder(generatedFolder);
                    console.log('removed generated ...');
                    // await sleep(1000);
                    fs.renameSync(templateFolder, generatedFolder);
                    console.log('copy generated ...');
                    await removeFolder(decompress);
                    console.log('done ...');
                });
        });
    }
github pathephone / pathephone-desktop / build / ipfs-download.js View on Github external
return new Promise((resolve, reject) => {
    console.log('unziping', file, 'to', path)
    fs.createReadStream(file).pipe(uz.Extract({ path })).on('close', () => {
      console.log('unziped!')
      resolve()
    })
  })
}
github yorkie / tensorflow-nodejs / scripts / download.js View on Github external
https.get(PROTOBUF_URL, (res) => {
  if (res.statusCode !== 200) {
    throw new Error(PROTOBUF_URL + ' ' + res.statusMessage);
  } else {
    console.log('Done,', PROTOBUF_URL + ' is finished downloaded.');
  }
  res.pipe(unzip.Extract({
    path: './protobuf'
  }));
});
github BlinkTagInc / node-gtfs / scripts / download.js View on Github external
function processFile(e, response, body){
        if(response && response.statusCode != 200){ cb(new Error('Couldn\'t download files')); }
        console.log(agency_key + ': Download successful');
  	
        fs.createReadStream(downloadDir + '/latest.zip')
          .pipe(unzip.Extract({ path: downloadDir }).on('close', cb))
          .on('error', handleError);
      }
    }
github lukessmith / hipims-ocl / tools / model-builder / ZipTools.js View on Github external
ZipTools.prototype.extract = function (archiveName, cb, targetDir) {
	if ( targetDir === undefined ) {
		targetDir = downloadTools.getDirectoryPath() + archiveName.replace(/_[A-Z]+\..+$/, '');
	}
	console.log('    Extracting ' + archiveName + ' to directory...');
	fs.createReadStream(downloadTools.getDirectoryPath() + archiveName)
	  .pipe(
		unzip.Extract({ 
			path: targetDir
		})
		.on('close', () => {
			console.log('    Finished extracting ' + archiveName + '.');
			if (cb) cb();
		})
	  );
};
github DST-Tools / DSTEd / Source / Classes / Core.js View on Github external
}.bind(this), function onEnd(file, path) {
						fs.createReadStream(file).pipe(UnZIP.Extract({
							path: path
						}).on('finish', function Finish() {
							fs.unlink(file, function onSuccess() {
								this.getScreen('SteamWorkshop').send('steam:workshop:event', {
									action:	'installed',
									id:		data.id
								});
								
								this.getScreen('SteamWorkshopDetails').send('steam:workshop:event', {
									action:	'installed',
									id:		data.id
								});
							}.bind(this));
						}.bind(this)));
					}.bind(this));
				}.bind(this));
github breach / node-thrust / scripts / bootstrap.js View on Github external
function(cb_) {
            fs.createReadStream(path.join(THRUST_PATH, THRUST_RELEASE_FILENAME))
              .on('error', cb_)
              .pipe(unzip.Extract({
                path: THRUST_PATH
              }).on('close', cb_));
          },
          function(cb_) {

unzip

Unzip cross-platform streaming API compatible with fstream and fs.ReadStream

MIT
Latest version published 10 years ago

Package Health Score

48 / 100
Full package analysis

Popular unzip functions