Registry / web-framework / express-processimage

express-processimage

JSON →
library11.2.0jsnpmunverified

Express middleware for on-the-fly image processing based on query string parameters. Version 11.2.0. Intended for development use, not production. Supports multiple image formats (PNG, JPG, GIF, SVG) and operations (resize, pngcrush, optipng, jpegtran, svgfilter, etc.). Uses impro module to switch between backends (GraphicsMagick, ImageMagick, command-line tools). Alternative to separate build tools. Note: due to shelling out to external binaries, it presents security concerns; validate inputs and limit image sizes in production.

npm install express-processimage
INSTALL
IMPORT
SIG · EXPRESS-PROCESSIMA
E
express-processimage
web-frameworkjavascriptv11.2.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import processImage from 'express-processimage'
const processImage = require('express-processimage')
CommonJS require works as default export
processImage
const processImage = require('express-processimage')
const { processImage } = require('express-processimage')
No named export; default export only
default
const processImage = require('express-processimage')
import { processImage } from 'express-processimage'
Must use default import

Set up Express server with express-processimage middleware to serve processed images via query parameters.

import express from 'express'; import processImage from 'express-processimage'; const app = express(); const root = '/path/to/images'; app.use(processImage({ root })); app.use(express.static(root)); app.listen(3000);
Debug
Known issues
breakingExpress 4.x requires app.use, not express().use()
fix
Use const app = express(); app.use(processImage({root})); app.listen(1337);
affects: >=4.0.0
deprecatedOption 'root' has been required since v5.0.0
fix
Always pass { root: '/path' } object.
affects: >=5.0.0
gotchaMiddleware must be placed before express.static to intercept images
fix
Order: app.use(processImage({root})), then app.use(express.static(root)).
affects: >=0.0.0
deprecatedQuery string tool names changed: 'optipng' deprecated in favor of 'pngcrush'
fix
Use 'pngcrush' instead of 'optipng'.
affects: >=10.0.0
breakingSupport for Node.js <10 removed in v8.0.0
fix
Upgrade Node.js to v10 or higher.
affects: >=8.0.0
gotchaETag modification can cause caching issues with CDN
fix
Set cache-control headers explicitly.
affects: >=0.0.0
Errors
Common errors & fixes
Error: spawn optipng ENOENT
optipng binary not installed
fix
Install optipng via package manager (e.g., apt-get install optipng).
TypeError: processImage is not a function
Imported incorrectly (named instead of default)
fix
Use const processImage = require('express-processimage') or import processImage from 'express-processimage'.
Error: Cannot find module 'impro'
Missing dependency
fix
Run npm install express-processimage to install all dependencies.
403 Forbidden: no root set
Root option not provided
fix
Add { root: '/path/to/images' } to processImage options.
Upgrade
Version history
11.2.0latest on npm
Audit
Dependencies
improrequiredCore image processing engine
hijackresponserequiredInterceptors response to modify image
expressrequiredHTTP framework
Agent activity
2 hits · last 30 days
node
2
Resources
express-processimage — npm install express-processimage · libregistry