Imagemin-simple
Replace images with minified one and generate small base64 image.
Usage
imagemin
$ npx imagemin-simple imagemin '**/*.{jpg,png,JPG,PNG,svg,gif}'
base64
$ npx imagemin-simple base64 '**/*.{jpg,png,JPG,PNG}' --output-file base64.json
output
API
imagemin-simple -h
imagemin-simple <command> Commands: imagemin-simple imagemin The imagemin command. imagemin-simple base64 Turn image into base64. Options: -v, --version Show version number [boolean] -h, --help Show help [boolean] For more information go to https://github.com/evenchange4/hsu-scripts
imagemin-simple imagemin -h
Usage: imagemin-simple imagemin <pattern> [options]<pattern> Glob pattern to specify files. Options: --plugin The list of plugins to use. [array] [default: ["jpegtran","pngquant","svgo","gifsicle"]] -h, --help Show help [boolean] [boolean] Examples: imagemin-simple imagemin '**/*.{jpg,png,JPG,PNG,svg,gif}' imagemin-simple imagemin '**/*.png' --plugin pngquant
imagemin-simple base64 -h
Usage: imagemin-simple base64 <pattern> [options]<pattern> Glob pattern to specify files. Options: --output-file The output json file. [string] [default: "./base64.json"] --cwd Set current working directory. [string] -h, --help Show help [boolean] Examples: imagemin-simple base64 '**/*.{jpg,png,JPG,PNG}' imagemin-simple base64 '**/*.{jpg,png,JPG,PNG}' --output-file results.json imagemin-simple base64 '**/*.png' --cwd './docs'
cwd
The current working directory.
- Default:
process.cwd()
- Examples:
# Default $ npm run test:base64 # Set custom cwd $ npm run test:base64-cwd
NOTE: Please check mrmlnc/fast-glob#cwd for more detail.
Development
- node 12.3.1
- yarn 1.16.0
$ yarn install --pure-lockfile$ npm run test:base64
Test
$ yarn run build$ yarn run flow-coverage$ yarn run test:watch$ yarn run test:base64$ yarn run test:base64-cwd$ yarn run format$ yarn run eslint
Publish
$ npm version patch$ npm run changeloggit commit & push
CONTRIBUTING
- ⇄ Pull requests and ★ Stars are always welcome.
- For bugs and feature requests, please create an issue.
- Pull requests must be accompanied by passing automated tests.