npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

imagemagick-native-promise

v1.0.3

Published

Promise wrapper for node-imagemagick-native library

Downloads

8

Readme

imagemagick-native-promise

Build Status

JavaScript Promise wrapper for node-imagemagick-native

Features

Promise supported methods

Please look full API reference at https://github.com/elad/node-imagemagick-native/blob/master/README.md

Original's table of contents

Examples

Convert formats

Convert from one format to another with quality control:

imagemagick.convert({
	srcData: fs.readFileSync('before.jpg'),
	format: 'PNG',
	quality: 100 // (best) to 1 (worst)
})
.then((buffer) => {
  fs.writeFileSync('after.png', buffer);
})
.catch((e) => {
  console.error(e);
})

Blur

Blur image:

imagemagick.convert({
	srcData: fs.readFileSync('before.jpg'),
	blur: 5
})
.then((buffer) => {
  fs.writeFileSync('after.jpg', buffer);
})
.catch((e) => {
  console.error(e);
})

Resize

Resized images by specifying width and height. There are three resizing styles:

  • aspectfill: Default. The resulting image will be exactly the specified size, and may be cropped.
  • aspectfit: Scales the image so that it will not have to be cropped.
  • fill: Squishes or stretches the image so that it fills exactly the specified size.
imagemagick.convert({
	srcData: fs.readFileSync('before_resize.jpg'),
	width: 100,
	height: 100,
	resizeStyle: 'aspectfill', // is the default, or 'aspectfit' or 'fill'
	gravity: 'Center' // optional: position crop area when using 'aspectfill'
})
.then((buffer) => {
  fs.writeFileSync('after_resize.jpg', buffer);
})
.catch((err) => {
  console.error(err);
})

Rotate, flip, and mirror

Rotate and flip images, and combine the two to mirror:

imagemagick.convert({
	srcData: fs.readFileSync('before_rotateflip.jpg'),
	rotate: 180,
	flip: true
})
.then((buffer) => {
  fs.writeFileSync('after_rotateflip.jpg', buffer);
})
.catch((err) => {
  console.error(err);
})