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

@localnerve/gulp-images

v0.3.0

Published

Reusable gulp image processing transforms: optimize (svg, jpeg, png), responsive, and transform (toWebp).

Readme

@localnerve/gulp-images

Portable (wasm & sharp), minimal dependency, streaming image processing for javascript builds. Optionally outputs image processing metadata to allow the images themselves to drive css generation and/or other work.

Reusable Gulp image-processing transforms extracted from jam-build.

Three functional groups — optimize, responsive, and transform — each independently importable and easily extensible.


Installation

npm install @localnerve/gulp-images

Requires gulp as a peer dependency.


Usage

Initialize WASM codecs first

All JPEG, PNG, and WebP operations rely on WASM modules that must be initialized before any pipeline runs.

import { initWasmModules } from '@localnerve/gulp-images';

// Use process.cwd() (default) or pass an explicit base path:
await initWasmModules();                        // looks for node_modules relative to cwd
await initWasmModules('/path/to/monorepo/root'); // explicit base path

Full pipeline example

import gulp from 'gulp';
import { initWasmModules, optimize, responsive, transform } from '@localnerve/gulp-images';

await initWasmModules();

const settings = {
  prod: true,
  svgoOptions:      { /* svgo options */ },
  mozjpegOptions:   { quality: 80 },
  oxipngOptions:    { level: 2 },
  webpOptions:      { quality: 80 },
  responsiveConfig: { /* gulp-responsive config */ }
};

const output = {}; // optional — receives image metadata from responsive + toWebp

gulp.series(
  function optimizeAndResponsive () {
    return gulp.src('dist/images/**', { encoding: false })
      .pipe(responsive.responsive(settings, output))
      .pipe(optimize.svg(settings))
      .pipe(optimize.jpeg(settings))
      .pipe(optimize.png(settings))
      .pipe(gulp.dest('dist/images'));
  },
  function convertToWebp () {
    return gulp.src('dist/images/**', { encoding: false })
      .pipe(transform.toWebp(settings, output))
      .pipe(gulp.dest('dist/images'));
  }
)();

Groups

optimize@localnerve/gulp-images/optimize

| Export | Description | |--------|-------------| | svg(settings) | Optimizes SVG files via svgo. No-op unless settings.prod === true. | | jpeg(settings) | Re-encodes JPEGs via mozjpeg (@jsquash/jpeg). No-op unless settings.prod === true. | | png(settings) | Optimizes PNGs via oxipng (@jsquash/oxipng). No-op unless settings.prod === true. |

Extend the group:

import * as optimize from '@localnerve/gulp-images/optimize';
const myOptimize = { ...optimize, avif: myAvifOptimizer };

settings keys used by optimize:

| Key | Type | Used by | |-----|------|---------| | prod | boolean | all — enables optimization | | svgoOptions | object | svg | | mozjpegOptions | object | jpeg | | oxipngOptions | object | png |


responsive@localnerve/gulp-images/responsive

| Export | Description | |--------|-------------| | responsive(settings, output?) | Generates responsive image variants via @localnerve/gulp-responsive. |

settings - The @localnerve/gulp-responsive config defined in the full configuration details.

output (optional) — if supplied, variant metadata is written as:

output[originalName][width] = { basename, mimeType }

settings keys used:

| Key | Type | Description | |-----|------|-------------| | responsiveConfig | object | Forwarded directly to gulp-responsive |


transform@localnerve/gulp-images/transform

| Export | Description | |--------|-------------| | toWebp(settings, output?) | Converts .jpg, .jpeg, and .png files to .webp using @jsquash/webp. |

output (optional) — if supplied, converted file metadata is updated:

output[key][width].basename = 'file.webp';
output[key][width].mimeType = 'image/webp';

The key and width are derived from the filename convention <key1>-<key2>-<width>.<ext> (same convention as gulp-responsive output).

Extend the group:

import * as transform from '@localnerve/gulp-images/transform';
const myTransform = { ...transform, toAvif: myAvifConverter };

settings keys used:

| Key | Type | Description | |-----|------|-------------| | webpOptions | object | Forwarded to the WebP encoder |


License

AGPL-3.0-or-later — Copyright (c) 2025 Alex Grant [email protected] (https://www.localnerve.com), LocalNerve LLC