1.0.5 • Published 2 years ago
bear-node-imagemin v1.0.5
bear-node-imagemin
- If you don't want to worry about the problems imagemin encounters in the runtime environment,
You can use
Docker image
(bear-imagemin-server) +npm package
(bear-imagemin-client) directly - If you want to use it directly in the project, just install
bear-node-imagemin
directly
Install
yarn add -D bear-node-imagemin
How to use
import {lossySquash, losslessSquash} from 'bear-node-imagemin';
const isLossLess = false;
const sourceFile = './example/static/source.png';
const params = {
quality: isLossLess ? undefined: quality,
resize: {width: 200, height: 200, ignoreOverflowSize: true},
extname: 'webp',
};
// file to buff
const bufferData = fs.readFileSync(sourceFile);
const newBuff = isLossLess ?
await losslessSquash(bufferData, params): // is lossLess
await lossySquash(bufferData, params); // is lossy
fs.writeFileSync('./example/static/lossySquash/image_1024.png', newBuff);
Use Docker Server + Client
see packages/bear-imagemin-server
and packages/bear-imagemin-client
Use CLI
see packages/bear-imagemin-cli
Release
in root dir
$ yarn build
$ npm publish --access=public
Document
License
MIT © imagine10255
1.0.5
2 years ago
1.0.4-alpha.3
2 years ago
1.0.4-alpha.2
2 years ago
1.0.4
2 years ago
1.0.4-alpha.1
2 years ago
1.0.4-alpha.0
2 years ago
1.0.3
2 years ago
1.0.3-alpha.1
2 years ago
1.0.3-alpha.2
2 years ago
1.0.3-alpha.0
3 years ago
1.0.2
3 years ago
1.0.1
3 years ago
1.0.0
3 years ago
0.0.15-alpha.6
3 years ago
0.0.15-alpha.5
3 years ago
0.0.15-alpha.4
3 years ago
0.0.15-alpha.3
3 years ago
0.0.15-alpha.2
3 years ago
0.0.15-alpha.1
3 years ago
0.0.11-alpha.1
3 years ago
0.0.11-alpha.0
3 years ago
0.0.10
3 years ago
0.0.9
3 years ago
0.0.8
3 years ago
0.0.7
3 years ago
0.0.6
3 years ago
0.0.5
3 years ago
0.0.4
3 years ago
0.0.3
3 years ago
0.0.2
3 years ago
0.0.1
3 years ago