1.0.0 • Published 7 years ago
img-autosize v1.0.0
img-autosize
Read all images in a directory and automatically resize them to various sizes, optimized for http serving.
Installation
npm install -g img-autosize
Usage
img-autosize config.json
img-autosize --watch config.json
Example Config
[{
"inputDir": "test_input",
"maxWidth": 400,
"maxHeight": 400,
"suffix": "_m",
"outputDir": "test_output"
}]
How it works
- read config file which is an array of
{ inputDir, maxWidth, maxHeight, suffix, outputDir }
- watch every jpeg, jpg, and png files in
inputDir
and its descentdant for changes - if a new file is added, a resized version of that file with
suffix
is created to theoutputDir
. - if a file is deleted, all resized version of that file is also deleted.
- if a file is changed, similar to when a file is created.
1.0.0
7 years ago