Easily configure imagemin to work with lint-staged. This npm package (v1.3.0, latest) provides a simple wrapper to run imagemin optimization on staged files within the lint-staged pipeline. It is designed for developers using lint-staged who want to automatically compress images (PNG, JPEG, GIF, SVG) as part of their pre-commit hooks. The package is lightweight but depends on imagemin and its plugins being installed separately. It is a niche utility with low release cadence (last update ~5 years ago). Alternative: use imagemin directly in a lint-staged config.
npm install lint-staged-imageminNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to use lint-staged-imagemin in a lint-staged configuration file to optimize images before commit.
Use import instead of require; if using CommonJS, install @esm2 cjs wrapper or use dynamic import.
Consider using imagemin directly in lint-staged config or switch to sharp-based tools.
Install imagemin and desired plugins as devDependencies.
Do not wrap with array brackets; the returned string is the command itself.
Change to import statement or use dynamic import().
Run: npm install --save-dev imagemin-pngquant
Use: import lintStagedImagemin from 'lint-staged-imagemin'
No dependency data recorded yet.