包详细信息

simple-webp-converter

vkiss462MIT1.0.3

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

webpconverter, webp-converter, webp, image

自述文件

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

更新日志

1.0.3

Publishing date: 2022-05-31

  • Fix: Revert import from 'package.module' refac

1.0.2

Publishing date: 2022-05-31

  • Build: Update glob dependency
  • Revert: package.module

1.0.1

Publishing date: 2022-04-21

  • Refac: package.module
  • Build: Update dev packages

1.0

Publishing date: 2021-09-16

  • First public release 🎉