How to use node-7z - 3 common examples

To help you get started, we’ve selected a few node-7z 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 dreamnettech / dreampower / scripts / release.js View on Github external
function zip() {
  console.log('Compressing build...')
  process.chdir(buildPath)

  const def = new Deferred()

  const sevenProcess = Seven.add(filePath, '*', {
    recursive: true
  })

  sevenProcess.on('error', (err) => {
    def.reject(err)
  })

  sevenProcess.on('end', (info) => {
    def.resolve()
  })

  return def.promise
}
github poooi / poi / build / utils.es View on Github external
export const compress7z = async (files, archive, options) => {
  options = {
    ...options,
    $bin: pathTo7zip,
  }
  try {
    await fs.remove(archive)
  } catch (e) {
    console.error(e.stack)
  }
  await Seven.add(archive, files, options)
}
github dreamnettech / dreamtime / src / electron / src / modules / tools / fs.js View on Github external
let pathTo7zip

  if (is.development) {
    pathTo7zip = sevenBin.path7za
  } else {
    const binName = platform({
      macos: '7za',
      linux: '7za',
      windows: '7za.exe',
    })

    pathTo7zip = getAppResourcesPath('7zip-bin', binName)
  }

  const seven = extractFull(path, destinationPath, {
    $bin: pathTo7zip,
    recursive: true,
  })

  seven.on('end', () => {
    def.resolve()
  })

  seven.on('error', (err) => {
    def.reject(err)
  })

  return def.promise
}

node-7z

A Node.js wrapper for 7-Zip with platform binaries

ISC
Latest version published 3 years ago

Package Health Score

56 / 100
Full package analysis

Popular node-7z functions