New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

thumbs

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

thumbs

Transform stream which reads files, creates thumbnails of them, and writes their filenames

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

thumbs

Transform stream which reads files, creates thumbnails of them, and writes their filenames.

build status dependency status dev dependency status

Example

var thumbs = require('thumbs');

var thumbnails = thumbs({
  small: {height: 256*2, quality: 25},
  large: {max: 1024*2, quality: 50},
  huge: {max: 1024*8, quality: 50}
});

thumbnails.write({
  src: 'test/img/hasselblad.jpg',
  dest: 'hasselblad.jpg'
});

thumbnails.on('data', function(obj) {
  console.log('thumbnailed:', obj);
});

Methods

var thumbs = require('thumbs')(formats);

Return a transform stream which reads {src: '', dest: ''} objects and writes {src: '', dest: ''} objects based on the given formats.

formats is an object where each key is used in the written dest name and each value can use the following opts:

  • width - pixel width of the thumbnail or relative to height if undefined
  • height - pixel height of the thumbnail or relative to width if undefined
  • max - pixel width or height of the thumbnail depending on which dimension is largest
  • quality - compression quality of the thumbnail (from 0 to 100)

Installation

Install imagemagick with your platform's native package manager:

apt-get install imagemagick
brew install imagemagick
pacman -S imagemagick

Install the NPM module:

npm install thumbs

License

MIT

Keywords

stream

FAQs

Package last updated on 08 Oct 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts