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

image-monitor

v1.1.6

Published

Monitor image directories for image processing

Downloads

69

Readme

image-monitor

Monitor image directories for image processing

NPM

Getting started

Install with npm:

npm install image-monitor

Then require and use it in your code:

const CropMonitor = require('image-monitor');
let opt = {
    watcher: {
        ignoreFiles: '',
        depth: 0
    },
    cropper: [{
        watchObj: 'images1',
        savePath: 'images',
        maxCropScale: -1,
        quality: 60,
        scaleSizeList: [{ width: 110, height: 110, quality: 70 }, { width: 240, height: 240, quality: 70 }, { width: 400, height: 400, quality: 70 }, { width: 800, height: 800, quality: 70 }, { width: 960, height: 960, quality: 70 }]
    }, {
        watchObj: 'images2',
        savePath: 'images',
        maxCropScale: -1,
        quality: 60,
        scaleSizeList: [{ width: 110, height: 110, quality: 70 }, { width: 240, height: 240, quality: 70 }, { width: 400, height: 400, quality: 70 }, { width: 800, height: 800, quality: 70 }, { width: 960, height: 960, quality: 70 }]
    }]
};

let crop = new CropMonitor(opt);
crop.cropOnAdd(true);
crop.deleteOnUnlink(true);

API

// Define argments of watcher and crop.
let opt = {
    watcher: {
        ignoreFiles: '',
        depth: 0
    },
    cropper: [{
        watchObj: 'images1',
        savePath: 'image save directory',
        maxCropScale: 1.5,
        quality: 70,// image quality
        scaleSizeList: [{ width: 110, height: 110, quality: 70 }, { width: 240, height: 240, quality: 70 }, { width: 400, height: 400, quality: 70 }, { width: 800, height: 800, quality: 70 }, { width: 960, height: 960, quality: 70 }]
    }, {
        watchObj: 'images2',
        savePath: 'image save directory',
        maxCropScale: 1.5,
        quality: 70,// image quality
        scaleSizeList: [{ width: 110, height: 110, quality: 70 }, { width: 240, height: 240, quality: 70 }, { width: 400, height: 400, quality: 70 }, { width: 800, height: 800, quality: 70 }, { width: 960, height: 960, quality: 70 }]
    }]
};

// Initialize CropMonitor.
let crop = new CropMonitor(opt);

// Set event method.
// Crop images when startup and before ready triggered.
crop.cropOnBeforeReady(true);

// Crop images when event of add triggered.
crop.cropOnAdd(true);

// Crop images when event of unlink triggered.
crop.deleteOnUnlink(true);

// Crop images when event of change triggered.
crop.cropOnChange(true);

new CropMonitor(opt)

  • opt (object) Images directory monitor configuration. Options object as defined below:watchercropper.

watcher

(object). watcher monitor configuration.

  • ignoreFiles (string of regular expression, default: /(^\..+)|(.+[\/\\]\..+)/).

    • Note: Supported format: '.jpg', '.jpeg', '.png', '.bmp', '.gif'.
  • depth (default: 0). If set, limits how many levels of subdirectories will be traversed.

cropper

(object array). cropper configuration.

  • watchObj (string). Paths to files, dirs to be watched recursively, or glob patterns.

    • Note: globs must not contain windows separators (\), because that's how they work by the standard — you'll need to replace them with forward slashes (/).
    • Note 2: for additional glob documentation, check out low-level library: picomatch.
  • savePath (string). Paths to files, dirs to be saved. If not set, savePath is parent directory of original file. Subdirectory is dynamic, that named by width and height of scaleSizeList. Naming format of subdirectory "width_height".

  • quality (number, default: 75). Set the quality of saved JPEG, 0 - 100.

  • scaleSizeList (object array). Crop the image size array.

Using help

License

MIT