How to use node-stream-zip - 6 common examples

To help you get started, we’ve selected a few node-stream-zip 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 InfiniteLibrary / infinite-electron / app / streamer / index.js View on Github external
return new Promise((resolve) => {
      const zip = new StreamZip({ file: book });
      zip.on('error', (err) => { console.error(err); });
      // this._zips[book] = zip;
      resolve(zip);
    });
  }
github SomeoneWeird / aergia / app / containers / entrypoints / soundhax / setup / index.js View on Github external
const extract = () => {
      let zip = new StreamZip({
        file: zipPath,
        storeEntries: true
      })

      zip.on('error', console.error)

      zip.on('ready', () => {
        zip.extract(null, config.drive.mountPoint, (err) => {
          if (err) {
            return console.error(err)
          }
          return extracted()
        })
      })
    }
github SomeoneWeird / aergia / app / containers / ctrtransfer / setup / index.js View on Github external
}, () => {
          let zip = new StreamZip({
            file: path.resolve(os.tmpdir(), zipName),
            storeEntries: true
          })

          zip.on('error', console.error)

          zip.on('ready', () => {
            zip.extract(null, path.resolve(config.drive.mountPoint, 'files9'), (err) => {
              if (err) {
                return console.error(err)
              }
              return this.setFinished()
            })
          })
        })
      })
github SomeoneWeird / aergia / app / containers / decrypt9 / setup / index.js View on Github external
this.downloadFile('decrypt9.zip', url, false, (err) => {
      if (err) {
        return console.error('Error downloading decrypt9...', err)
      }

      let zip = new StreamZip({
        file: path.resolve(os.tmpdir(), 'decrypt9.zip'),
        storeEntries: true
      })

      zip.on('error', console.error)

      const fileName = 'Decrypt9WIP.bin'

      zip.on('ready', () => {
        zip.extract(fileName, os.tmpdir(), (err) => {
          if (err) {
            return console.error(err)
          }
          fsextra.move(path.resolve(os.tmpdir(), fileName), path.resolve(config.drive.mountPoint, 'safehaxpayload.bin'), (err) => {
            if (err) {
              return console.error(err)
github Opentrons / opentrons / app-shell / src / buildroot / release-files.js View on Github external
const openZip = new Promise((resolve, reject) => {
    const zip = new StreamZip({ file: systemFile, storeEntries: true })
      .once('ready', handleReady)
      .once('error', handleError)

    function handleReady() {
      cleanup()
      resolve(zip)
    }

    function handleError(error: Error) {
      cleanup()
      zip.close()
      reject(error)
    }

    function cleanup() {
      zip.removeListener('ready', handleReady)
github SanderRonde / CustomRightClickMenu / gulpfile.ts View on Github external
await new Promise((resolve, reject) => {
							const zip = new StreamZip({
								file: 'artifacts.build.zip',
								storeEntries: true
							});
		
							mkdirp(path.join(__dirname, 'build/'), (err) => {
								if (err) {
									reject(err);
								} else {
									zip.on('ready', () => {
										zip.extract(null, path.join(__dirname, 'build/'), (err) => {
											if (err) {
												reject(err);
											} else {
												zip.close();
												resolve();
											}

node-stream-zip

node.js library for reading and extraction of ZIP archives

MIT
Latest version published 3 years ago

Package Health Score

67 / 100
Full package analysis

Popular node-stream-zip functions