How to use jimp-compact - 1 common examples

To help you get started, we’ve selected a few jimp-compact 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 nuxt-community / pwa-module / lib / icon / resize.js View on Github external
async function resize ({ input, distDir, sizes }) {
  const inputFile = await Jimp.read(input)

  await Promise.all(sizes.map(size => {
    const distFile = path.join(distDir, `${size}.png`)
    return new Promise(resolve => {
      inputFile.clone().contain(size, size).write(distFile, () => resolve())
    })
  }))
}

jimp-compact

Compact version of Jimp

MIT
Latest version published 3 years ago

Package Health Score

68 / 100
Full package analysis

Popular jimp-compact functions

Similar packages