{"id":13527255,"url":"https://github.com/sindresorhus/gulp-imagemin","last_synced_at":"2025-05-13T22:05:01.092Z","repository":{"id":12857055,"uuid":"15533082","full_name":"sindresorhus/gulp-imagemin","owner":"sindresorhus","description":"Minify PNG, JPEG, GIF and SVG images","archived":false,"fork":false,"pushed_at":"2024-05-05T20:14:24.000Z","size":219,"stargazers_count":1904,"open_issues_count":27,"forks_count":157,"subscribers_count":29,"default_branch":"main","last_synced_at":"2025-04-20T03:29:00.055Z","etag":null,"topics":["compress-images","gulp-plugin","imagemin","javascript","minify-images","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"electron/electron-quick-start","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sindresorhus.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/security.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"sindresorhus","open_collective":"sindresorhus","buy_me_a_coffee":"sindresorhus","custom":"https://sindresorhus.com/donate"}},"created_at":"2013-12-30T17:53:03.000Z","updated_at":"2025-03-16T17:05:30.000Z","dependencies_parsed_at":"2024-01-13T10:40:35.608Z","dependency_job_id":"35f9fa15-03f5-4e2a-aced-bf84f91bd5fc","html_url":"https://github.com/sindresorhus/gulp-imagemin","commit_stats":{"total_commits":159,"total_committers":26,"mean_commits":6.115384615384615,"dds":"0.30817610062893086","last_synced_commit":"dc0625560defe128fe4b04f1f9d7db2c66e2c2a2"},"previous_names":[],"tags_count":49,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fgulp-imagemin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fgulp-imagemin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fgulp-imagemin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fgulp-imagemin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sindresorhus","download_url":"https://codeload.github.com/sindresorhus/gulp-imagemin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251118949,"owners_count":21539190,"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":["compress-images","gulp-plugin","imagemin","javascript","minify-images","nodejs"],"created_at":"2024-08-01T06:01:44.210Z","updated_at":"2025-04-28T15:27:41.048Z","avatar_url":"https://github.com/sindresorhus.png","language":"JavaScript","funding_links":["https://github.com/sponsors/sindresorhus","https://opencollective.com/sindresorhus","https://buymeacoffee.com/sindresorhus","https://sindresorhus.com/donate"],"categories":["Plugins","Image Optimizers","Getting Started","JavaScript","插件","⚙️ Backend \u0026 APIs"],"sub_categories":["Minification","Overview","Meetups","压缩"],"readme":"# gulp-imagemin\n\n\u003e Minify PNG, JPEG, GIF and SVG images with [`imagemin`](https://github.com/imagemin/imagemin)\n\n*Issues with the output should be reported on the [`imagemin` issue tracker](https://github.com/imagemin/imagemin/issues).*\n\n## Install\n\n```sh\nnpm install --save-dev gulp-imagemin\n```\n\n## Usage\n\n### Basic\n\n```js\nimport gulp from 'gulp';\nimport imagemin from 'gulp-imagemin';\n\nexport default () =\u003e (\n\tgulp.src('src/images/*')\n\t\t.pipe(imagemin())\n\t\t.pipe(gulp.dest('dist/images'))\n);\n```\n\n### Custom plugin options\n\n```js\nimport imagemin, {gifsicle, mozjpeg, optipng, svgo} from 'gulp-imagemin';\n\n// …\n.pipe(imagemin([\n\tgifsicle({interlaced: true}),\n\tmozjpeg({quality: 75, progressive: true}),\n\toptipng({optimizationLevel: 5}),\n\tsvgo({\n\t\tplugins: [\n\t\t\t{\n\t\t\t\tname: 'removeViewBox',\n\t\t\t\tactive: true\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'cleanupIDs',\n\t\t\t\tactive: false\n\t\t\t}\n\t\t]\n\t})\n]))\n// …\n```\n\n### Custom plugin options and custom `gulp-imagemin` options\n\n```js\nimport imagemin, {svgo} from 'gulp-imagemin';\n\n// …\n.pipe(imagemin([\n\tsvgo({\n\t\tplugins: [\n\t\t\t{\n\t\t\t\tname: 'removeViewBox',\n\t\t\t\tactive: true\n\t\t\t}\n\t\t]\n\t})\n], {\n\tverbose: true\n}))\n// …\n```\n\n## API\n\nComes bundled with the following optimizers:\n\n- [gifsicle](https://github.com/imagemin/imagemin-gifsicle) — *Compress GIF images, lossless*\n- [mozjpeg](https://github.com/imagemin/imagemin-mozjpeg) — *Compress JPEG images, lossy*\n- [optipng](https://github.com/imagemin/imagemin-optipng) — *Compress PNG images, lossless*\n- [svgo](https://github.com/imagemin/imagemin-svgo) — *Compress SVG images, lossless*\n\nThese are bundled for convenience and most users will not need anything else.\n\n### imagemin(plugins?, options?)\n\nUnsupported files are ignored.\n\n#### plugins\n\nType: `Array`\\\nDefault: `[gifsicle(), mozjpeg(), optipng(), svgo()]`\n\n[Plugins](https://www.npmjs.com/browse/keyword/imageminplugin) to use. This will completely overwrite all the default plugins. So, if you want to use custom plugins and you need some of defaults too, then you should pass default plugins as well. Note that the default plugins come with good defaults and should be sufficient in most cases. See the individual plugins for supported options.\n\n#### options\n\nType: `object`\n\n##### verbose\n\nType: `boolean`\\\nDefault: `false`\n\nEnabling this will log info on every image passed to `gulp-imagemin`:\n\n```\ngulp-imagemin: ✔ image1.png (already optimized)\ngulp-imagemin: ✔ image2.png (saved 91 B - 0.4%)\n```\n\n##### silent\n\nType: `boolean`\\\nDefault: `false`\n\nDon't log the number of images that have been minified.\n\nYou can also enable this from the command-line with the `--silent` flag if the option is not already specified.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fgulp-imagemin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsindresorhus%2Fgulp-imagemin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fgulp-imagemin/lists"}