How to use the pngquant-bin.replace function in pngquant-bin

To help you get started, we’ve selected a few pngquant-bin 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 meowtec / Imagine / modules / optimizers / pngquant.ts View on Github external
io(input: string, output: string) {
    const { color = 256 } = this.options

    const pngquantBinFixed = pngquantBin.replace('app.asar', 'app.asar.unpacked')

    return spawn(pngquantBinFixed, [
      color.toString(),
      input,
      '-o',
      output,
    ], {
      capture: [ 'stdout', 'stderr' ],
    }).catch(e => {
      throw new Error(e.message + '\n' + e.stderr)
    })
  }
}

pngquant-bin

`pngquant` wrapper that makes it seamlessly available as a local dependency

GPL-3.0+
Latest version published 7 months ago

Package Health Score

64 / 100
Full package analysis

Popular pngquant-bin functions