node-thumbnail
thumbnail all the things
node-thumbnail creates a queue of images and converts them asynchronously into thumbnails. node-thumbnail has no binary dependencies --- only javascript.
Command-line usage
thumb [options] source/path dest/path
options:
-h, --help
-v, --version
-s SUFFIX, --suffix SUFFIX
-p PREFIX, --prefix PREFIX
-d, --digest
-t TYPE, --hashing-type TYPE
-w, --width
-c NUM, --concurrency NUM
-o, --overwrite
-s, --skip
-i, --ignore
-q, --quiet
API
You can use this library with callbacks, or with promises.
callbacks
var thumb = thumb; // thumb(options, callback); ;
default options:
defaults = prefix: '' suffix: '_thumb' digest: false hashingType: 'sha1' // 'sha1', 'md5', 'sha256', 'sha512' width: 800 concurrency: <num of cpus> quiet: false // if set to 'true', console.log status messages will be supressed overwrite: false skip: false // Skip generation of existing thumbnails basename: undefined // basename of the thumbnail. If unset, the name of the source file is used as basename. ignore: false // Ignore unsupported files in "dest" { console; };
Note you must specify at least source
and destination
promises
The options that you can pass in are the same as above.
;
Installation
$ npm install node-thumbnail
License
BSD, short and sweet