Skip to content

Small node library for converting jpg and png images to webp file format with command line

License

Notifications You must be signed in to change notification settings

vkiss/simple-webp-converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple-webp-converter

npm version

A node library for converting .png and .jpg to .webp using webp-converter.

Instalation

npm i simple-webp-converter --save-dev

How

# package.json

{
  "scripts": {
    "webp": "simple-webp-converter"
  },
}
npm run webp

Running this will create a .webp copy on the same path as any .png or .jpg file (node_modules is excluded by default).

Options

To change config, include the "simple-webp-converter" property in package.json

src

Changes pattern to look for imagens in repository. The value must be a glob pattern string

# package.json

{
  "simple-webp-converter": {
    "src": "src/**/*.{png,jpg}"
  }
}

Running with this configuration will create a .webp copy on the same path as the .png and .jpgs files located under /src folder

How (in JS)

const simpleWebpConverter = require( "simple-webp-converter" );

// to run using default glob pattern
simpleWebpConverter();

// to run using custom pattern
simpleWebpConverter({
  src: "assets/**/*.{png,jpg}"
});

About

Small node library for converting jpg and png images to webp file format with command line

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published