@houshuang/resize-img

1.2.3 • Public • Published

resize-img Build Status

Resize images in memory

Install

$ npm install --save resize-img

Usage

const fs = require('fs');
const resizeImg = require('resize-img');

resizeImg(fs.readFileSync('unicorn.png'), {width: 128, height: 128}).then(buf => {
	fs.writeFileSync('unicorn-128x128.png', buf);
});

API

resizeImg(input, options)

input

Type: buffer

An image buffer. Supported formats are bmp, jpg and png.

options

width

Type: number

Desired width of the target image.

height

Type: number

Desired height of the target image.

Related

License

MIT © Kevin Martensson

Package Sidebar

Install

npm i @houshuang/resize-img

Weekly Downloads

2

Version

1.2.3

License

MIT

Unpacked Size

532 kB

Total Files

15

Last publish

Collaborators

  • houshuang