simple-webp-converter

1.0.3 • Public • Published

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}"
});

/simple-webp-converter/

    Package Sidebar

    Install

    npm i simple-webp-converter

    Weekly Downloads

    64

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    6.7 kB

    Total Files

    8

    Last publish

    Collaborators

    • vinik