optipng-neo
v10.0.0
Published
OptiPNG wrapper that makes it seamlessly available as a local dependency
Maintainers
Readme
optipng-neo
A modern fork of
optipng‑bin– a wrapper for OptiPNG that makes it available as a local dependency without global installation. OptiPNG is an advanced PNG optimizer that recompresses image files to a smaller size without losing any information.
Why optipng‑neo?
This package continues the development of the original optipng‑bin with a focus on modern stack (ESM, TypeScript, node:child_process), improved documentation, and production readiness. Fully compatible with existing workflows while bringing freshness and reliability.
🚀 Install
npm install optipng-neoOr via pnpm / yarn:
pnpm add optipng-neo📦 Usage
Programmatic API (ESM)
import { execFile } from "node:child_process";
import { join } from "node:path";
import { cwd } from "node:process";
import { optipng } from "optipng-neo";
const __dirname = cwd();
const file = join(__dirname, "test", "input.png");
const out = join(__dirname, "test", "output.png");
execFile(optipng, ["-out", out, file], (error) => {
if (error) throw error;
console.log("✅ Image optimized!");
});CLI (global install)
npm install --global optipng-neoAfter installation, the optipng command becomes available in your terminal:
optipng --helpExample optimization:
optipng -o7 input.png -out output.png✨ What's inside?
- 🔗 Full compatibility with all flags and parameters of the original OptiPNG.
- 🌍 Automatic binary download for your platform (Windows, macOS, Linux) – no manual downloads needed.
- ⚡ Pure ESM + TypeScript – modular architecture ready for modern environments.
- 📦 No global installation required – OptiPNG works as a local dependency, ensuring reproducible builds.
- 📏 Lightweight dependency – only the necessary files, no extra bloat in
node_modules. - 🛠️ Native API – uses
node:child_process, avoiding legacy solutions.
🔧 Who is it for?
- Frontend developers who want to integrate PNG optimization into their build pipelines (Webpack, Vite, Gulp, Rollup).
- Teams where reproducibility matters – the binary is pinned inside
node_modules, eliminating environment discrepancies. - CI/CD engineers tired of global dependency issues on build servers.
- Any project that needs reliable, self‑contained PNG optimization without extra complexity.
📄 License
MIT License. Copyright (c) 2026 pasmurno by llcawc. Made with ❤️ for beautiful architecture.
If you need a higher‑level tool, check out imagemin-optipng or psimage.
