Registry / devops / arjan-optimize

arjan-optimize

JSON →
library0.6.6jsnpmunverified

A CLI tool that optimizes static assets (HTML, CSS, JS, SVG, images) by applying minification and compression using popular modules like Terser, csso, html-minifier, Sharp, and SVGO. Current stable version is 0.6.6. Release cadence is infrequent; last update was several years ago. Key differentiator is a single command to optimize all assets recursively, with multipage support and built-in WebP conversion. However, the project appears unmaintained with no recent releases.

npm install arjan-optimize
INSTALL
IMPORT
SIG · ARJAN-OPTIMIZE
A
arjan-optimize
devopsjavascriptv0.6.6
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

optimize
import { optimize } from 'arjan-optimize'
const optimize = require('arjan-optimize')
Package is ESM-only since v0.5. CommonJS require will fail.
run
import { run } from 'arjan-optimize/lib/cli'
import { run } from 'arjan-optimize'
CLI entry is in lib/cli; main export is the API function.
default
import arjanOptimize from 'arjan-optimize'
import { optimize } from 'arjan-optimize' (if expecting default)
Default export is a function, not the named 'optimize'.

Demonstrates basic usage: optimizing HTML, CSS, JS, and converting images to WebP.

// Install: npm install arjan-optimize import { optimize } from 'arjan-optimize'; // Optimize all assets in current directory recursively await optimize({ inputDir: process.cwd(), outputDir: './dist', formats: { html: { minify: true }, css: { minify: true }, js: { minify: true }, images: { webp: true, quality: 80 } } });
Debug
Known issues
deprecatedPackage is unmaintained since 2021. Use at your own risk; consider using individual tools like imagemin, terser, csso directly.
fix
Migrate to alternative tools.
affects: >=0.1.0
breakingVersion 0.5.0 changed the import path from 'arjan-optimize' to 'arjan-optimize/dist' for CommonJS users.
fix
Update import to 'arjan-optimize/dist' or switch to ESM.
affects: >=0.5.0 <0.6.0
gotchaThe package does not support streaming; for large projects memory usage may be high.
fix
Process assets in batches or use alternative tools with streaming support.
affects: >=0.1.0
gotchaSharp native binaries may fail to install on some systems (e.g., Alpine Linux). Ensure libvips is available.
fix
Install system dependencies: libvips, or use the --ignore-scripts flag and install sharp separately.
affects: >=0.1.0
Errors
Common errors & fixes
TypeError: arjanOptimize is not a function
CommonJS require incorrectly used on ESM package.
fix
Use import instead of require().
Error: Cannot find module 'sharp'
Sharp native binaries not installed or missing system dependencies.
fix
Run 'npm rebuild sharp' or install libvips (Linux).
Error: ENOENT: no such file or directory, open '...'
Input directory does not exist or is not accessible.
fix
Ensure the inputDir exists and is readable.
Upgrade
Version history
0.6.6latest on npm
Audit
Dependencies
terserrequiredJavaScript minification
cssorequiredCSS minification
html-minifierrequiredHTML minification
sharprequiredImage optimization (JPEG, PNG, WebP, GIF, TIFF)
svgorequiredSVG optimization
Agent activity
11 hits · last 30 days
node
10
OpenAI (training)
1
Resources
arjan-optimize — npm install arjan-optimize · libregistry