@nvptech/image-gen
TypeScript icon, indicating that this package has built-in type declarations

2.2.0 • Public • Published

@nvptech/image-gen

Image sizes generator for your static images

How to use

You can use npx to execute this lib, input path is the image that you want to generate, output path is your path that should be able to write generated images

npx @nvptech/image-gen gen <input> <output>

Generate images

npx @nvptech/image-gen gen ./path/to/your/image.png .path/to/your/output

Get help

npx @nvptech/image-gen --help

Custom folder name

npx @nvptech/image-gen -f gens ./path/to/your/image.png .path/to/your/output

Using config

you can use both js or json by declaring the config if you're using js you need to exports the config using module.exports

npx @nvptech/image-gen -c ./path/to/config.[js|json]

Using config example

./gen.config.js

module.exports = {
  input: './examples/js/img-gen/input/logo.png', // required
  output: './examples/js/img-gen/output', // required
  folderName: 'ayo-logos', // optional
  sizes: [
    {
      width: 72,
      height: 72,
      name: 'android-chrome',
      ext: '.png',
    }
  ] // required | at least one array
}

then

npx @nvptech/image-ge -c ./gen.config.js

Package Sidebar

Install

npm i @nvptech/image-gen

Weekly Downloads

0

Version

2.2.0

License

none

Unpacked Size

24.1 kB

Total Files

17

Last publish

Collaborators

  • nvpdev