基于cwebp-bin vendor下的资源转存wishstart
npm install cwebp-bin-wishstart```
$ npm install cwebp-bin-wishstart
`js
const { execFile } = require("child_process");
const cwebp = require("cwebp-bin-wishstart");
execFile(cwebp, ["input.png", "-o", "output.webp"], (err) => {
if (err) {
throw err;
}
console.log("Image is converted!");
});
`
``
$ npm install --global cwebp-bin-wishstart
```
$ cwebp --help