Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including multi-resize with all npm packages installed. Try it out:

var multiResize = require("multi-resize")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

multi-resize v2.3.0

Makes many smaller images out of one source PNG

Multi Resize

Resizes a PNG to many sizes at once!
Made by Jack Baron

Setup

yarn add multi-resize or npm i -S multi-resize

const path = require('path')
const MultiResize = require('multi-resize')
const image = new MultiResize(path.join(__dirname, 'path', 'to', 'image.png'))

Docs

  • MultiResize
    • new MultiResize(input)
    • .resizeOnce(size) ⇒ Promise.<Object>
    • .resizeMany(sizes) ⇒ Promise.<Array>

new MultiResize(input)

Multi Resize

ParamTypeDescription
inputstringFile path to PNG File

multiResize.resizeOnce(size) ⇒ Promise.<Object>

Resize Once

Kind: instance method of MultiResize
Returns: Promise.<Object> - - Buffer and Size keys
Throws: Promise.<Error>

ParamTypeDescription
sizeintegerX/Y Size to Scale To

multiResize.resizeMany(sizes) ⇒ Promise.<Array>

Resize To an Array of Sizes

Kind: instance method of MultiResize
Returns: Promise.<Array> - - Array of Buffer and Size keys
Throws: Promise.<Error>

ParamTypeDescription
sizesArrayX/Y Size to Scale To

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free