{"id":19219627,"url":"https://github.com/squirrel-forge/node-minify-images","last_synced_at":"2026-02-10T02:05:59.121Z","repository":{"id":57162166,"uuid":"432206487","full_name":"squirrel-forge/node-minify-images","owner":"squirrel-forge","description":"Simple images compiler including some useful configuration options. ","archived":false,"fork":false,"pushed_at":"2024-07-22T13:22:36.000Z","size":49,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-11T23:47:56.798Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/squirrel-forge.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-26T14:29:43.000Z","updated_at":"2024-07-22T13:22:40.000Z","dependencies_parsed_at":"2024-11-09T14:34:48.279Z","dependency_job_id":"f7d04019-5542-4faf-8c3f-106be1208088","html_url":"https://github.com/squirrel-forge/node-minify-images","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squirrel-forge%2Fnode-minify-images","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squirrel-forge%2Fnode-minify-images/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squirrel-forge%2Fnode-minify-images/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squirrel-forge%2Fnode-minify-images/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/squirrel-forge","download_url":"https://codeload.github.com/squirrel-forge/node-minify-images/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244656734,"owners_count":20488641,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T14:32:17.235Z","updated_at":"2026-02-10T02:05:59.062Z","avatar_url":"https://github.com/squirrel-forge.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @squirrel-forge/minify-images\nSimple imagemin compiler including some useful configuration options.\nMade to be compatible with node ^10.0.0, might work on higher versions, but currently not supported or tested.\n\n## imagemin\n\nnpm: [imagemin](https://www.npmjs.com/package/imagemin/v/7.0.1)\nVersion: 7.0.1\nNote: last version compatible with node ^10.0.0\n\n## Installation\n\n```\nnpm i @squirrel-forge/minify-images\n\n```\n\nAll imagemin plugins are optional, to allow for a custom setup if required. Install your required plugins and then use the *--no-optional* flag when installing minify-images. See the [plugins section](#plugins) for compatibility and more information.\n\n## cli usage\n\nIf you installed globally with the *-g* option.\n```\nminify-images target -b --boolean --str=imagemin-webp,imagemin-svgo\nminify-images source target -b --boolean --str=imagemin-webp,imagemin-svgo\n\n```\n\nFor local installations use *npx* to run the minify-images executable.\n```\nnpx minify-images ...\n\n```\n\n### Arguments\n\nThe source argument can be a single file path or folder.\nThe target argument must be a directory and will be created if it does not exist.\n\n#### Using only one argument\n\nthe source argument is omitted and assumed to be the current working directory\n1. target - Path to write optimized image files\n\n#### Using two arguments\n\n1. source - Path from where to read, if a directory, files are fetched with following options: ```{ extensions : /\\.(gif|jpg|jpeg|png|svg|webp)/ }```\n2. target - Path to write optimized image files\n\n### Options\n\nA long option always override the value of a short option if both are used.\n\n| Short | Long         |   Type   | Description                                                                      |\n|-------|--------------| -------- |----------------------------------------------------------------------------------|\n| -x    | --use-webp   |   bool   | Convert to webp format, only jpeg/png                                            |\n| -p    | --plugins    | str, ... | Define which plugins to use                                                      |\n| -c    | --colors     | str, ... | Define verbose listing color kib limits, must be 3 integers \u003e 0                  |\n| -n    | --no-map     |   bool   | Do not use a hashmap, should use this option for single file argument            |\n| -f    | --squash-map |   bool   | Ignore existing map, no map will be loaded and any existing map is replaced      |\n| -o    | --options    | 'no',str | Load options from this path, unless set to 'no', if not set regular checks apply |\n| -l    | --parallel   |   bool   | Process files in parallel, might be a little faster with lots of files           |\n|       | --defaults   |   bool   | Deploy default config to cwd or target directory                                 |\n| -s    | --stats      |   bool   | Show stats output                                                                |\n| -i    | --verbose    |   bool   | Show additional info                                                             |\n| -u    | --loose      |   bool   | Run in loose mode, disables the strict option                                    |\n| -v    | --version    |   bool   | Show the application version                                                     |\n\n## Config file\n\nPlugin options can be set by a *.minify-images* json format file containing options objects for each plugin you wish to customize, see following example:\n\nFile: *.minify-images*\n```\n{\n  \"imagemin-mozjpeg\": {\n    \"quality\": 80,\n    \"progressive\": false\n  }\n  ...\n}\n```\n\nThe config is loaded in following order:\n\n 1. If you specified a config path it will be checked first.\n 2. Your current working directory, from where you are running the command usually.\n 3. The source root directory, from where the source file or files are loaded.\n\nIf none of the above resolve to a valid config, defaults are used.\n\n## Map file\n\nThe *.minify-images.map* file is only a json map of paths with file content hashes, see the [options](#options) *-n* and *-f* for more details.\n\n## NPM scripts\n\nWhen installed locally use following scripts.\n\n```\n...\n\"scripts\": {\n    \"images:publish\": \"npx minify-images src/img dist/img\",\n}\n...\n\n```\n\n## Api usage\n\nYou can require the ImagesCompiler class in your node script and run it, change internal options and extend it easily, look at the cli implementation and code comments to understand what to run in which order, currently there will be no extended documentation on the js api, since code comments should be sufficient to understand what works in which way.\n\n## Plugins\n\nDefault plugins that are included as optional dependencies, with some additional notes, can be found below:\n \n### imagemin-gifsicle\n\nnpm: [imagemin-gifsicle](https://www.npmjs.com/package/imagemin-gifsicle/v/7.0.0)\nVersion: 7.0.0\nNote: upto date version at time of release.\n\n### imagemin-mozjpeg\n\nnpm: [imagemin-mozjpeg](https://www.npmjs.com/package/imagemin-mozjpeg/v/9.0.0)\nVersion: 9.0.0\nNote: upto date version at time of release.\n\n### imagemin-pngquant\n\nnpm: [imagemin-pngquant](https://www.npmjs.com/package/imagemin-pngquant/v/9.0.2)\nVersion: 9.0.2\nNote: upto date version at time of release.\n\n### imagemin-svgo\n\nnpm: [imagemin-svgo](https://www.npmjs.com/package/imagemin-svgo/v/8.0.0)\nVersion: 8.0.0\nNote: last version compatible with node ^10.0.0\n\n### imagemin-webp\n\nnpm: [imagemin-webp](https://www.npmjs.com/package/imagemin-webp/v/6.0.0)\nVersion: 6.0.0\nNote: upto date version at time of release.\n\n### Plugin issues\n\n```\n┌───────────────┬──────────────────────────────────────────────────────────────┐\n│ Moderate      │ Regular Expression Denial of Service (ReDOS)                 │\n├───────────────┼──────────────────────────────────────────────────────────────┤\n│ Package       │ semver-regex                                                 │\n├───────────────┼──────────────────────────────────────────────────────────────┤\n│ Patched in    │ \u003e=3.1.3                                                      │\n├───────────────┼──────────────────────────────────────────────────────────────┤\n│ Dependency of │ imagemin-webp                                                │\n├───────────────┼──────────────────────────────────────────────────────────────┤\n│ Path          │ imagemin-webp \u003e cwebp-bin \u003e bin-wrapper \u003e bin-version-check  │\n│               │ \u003e bin-version \u003e find-versions \u003e semver-regex                 │\n├───────────────┼──────────────────────────────────────────────────────────────┤\n│ More info     │ https://nodesecurity.io/advisories/1005009                   │\n└───────────────┴──────────────────────────────────────────────────────────────┘\n\n```\n \u003e in: imagemin-gifsicle, imagemin-mozjpeg, imagemin-pngquant, imagemin-webp\n\n```\n┌───────────────┬──────────────────────────────────────────────────────────────┐\n│ Moderate      │ Inefficient Regular Expression Complexity in nth-check       │\n├───────────────┼──────────────────────────────────────────────────────────────┤\n│ Package       │ nth-check                                                    │\n├───────────────┼──────────────────────────────────────────────────────────────┤\n│ Dependency of │ imagemin-svgo                                                │\n├───────────────┼──────────────────────────────────────────────────────────────┤\n│ Path          │ imagemin-svgo \u003e svgo \u003e css-select \u003e nth-check                │\n├───────────────┼──────────────────────────────────────────────────────────────┤\n│ More info     │ https://nodesecurity.io/advisories/1004967                   │\n└───────────────┴──────────────────────────────────────────────────────────────┘\n\n```\n \u003e in: imagemin-svgo\n\n```\n┌───────────────┬──────────────────────────────────────────────────────────────┐\n│ High          │ Regular Expression Denial of Service in trim-newlines        │\n├───────────────┼──────────────────────────────────────────────────────────────┤\n│ Package       │ trim-newlines                                                │\n├───────────────┼──────────────────────────────────────────────────────────────┤\n│ Patched in    │ \u003e=3.0.1                                                      │\n├───────────────┼──────────────────────────────────────────────────────────────┤\n│ Dependency of │ imagemin-webp                                                │\n├───────────────┼──────────────────────────────────────────────────────────────┤\n│ Path          │ imagemin-webp \u003e cwebp-bin \u003e logalot \u003e squeak \u003e lpad-align \u003e  │\n│               │ meow \u003e trim-newlines                                         │\n├───────────────┼──────────────────────────────────────────────────────────────┤\n│ More info     │ https://nodesecurity.io/advisories/1005151                   │\n└───────────────┴──────────────────────────────────────────────────────────────┘\n\n```\n \u003e in: imagemin-webp\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquirrel-forge%2Fnode-minify-images","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsquirrel-forge%2Fnode-minify-images","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquirrel-forge%2Fnode-minify-images/lists"}