https://github.com/weibozzz/images-to-webp
批量自动将 png 或者 jpg/jpeg 格式图片变为 webp
https://github.com/weibozzz/images-to-webp
Last synced: about 2 months ago
JSON representation
批量自动将 png 或者 jpg/jpeg 格式图片变为 webp
- Host: GitHub
- URL: https://github.com/weibozzz/images-to-webp
- Owner: Weibozzz
- Created: 2023-03-10T01:55:55.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-03-10T01:56:25.000Z (about 2 years ago)
- Last Synced: 2025-01-28T02:42:08.204Z (4 months ago)
- Language: JavaScript
- Size: 611 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# images-to-webp
批量自动将 png 或者 jpg/jpeg 格式图片变为 webp
## 快速使用
```shell
npm i images-to-webp -D
```
```js
const imagesToWebp = require('./index')
const path = require('path')
function resolve (filePath) {
return path.join(__dirname, filePath)
}
imagesToWebp({
quality: 20,
hashPath: resolve('./hash.json'),
imgsPath: resolve('./images')
}
)```