{"id":13835037,"url":"https://github.com/imagemin/imagemin-webp","last_synced_at":"2025-05-15T08:10:59.179Z","repository":{"id":20428576,"uuid":"23705182","full_name":"imagemin/imagemin-webp","owner":"imagemin","description":"WebP plugin for imagemin","archived":false,"fork":false,"pushed_at":"2023-06-29T19:45:42.000Z","size":56,"stargazers_count":502,"open_issues_count":20,"forks_count":43,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-05-08T23:35:24.604Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/imagemin.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":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-09-05T14:09:15.000Z","updated_at":"2025-03-27T14:34:16.000Z","dependencies_parsed_at":"2024-06-18T12:20:42.171Z","dependency_job_id":null,"html_url":"https://github.com/imagemin/imagemin-webp","commit_stats":{"total_commits":80,"total_committers":11,"mean_commits":"7.2727272727272725","dds":0.6125,"last_synced_commit":"88304e86aae79a1795de27ee6fe794788328184b"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imagemin%2Fimagemin-webp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imagemin%2Fimagemin-webp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imagemin%2Fimagemin-webp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imagemin%2Fimagemin-webp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imagemin","download_url":"https://codeload.github.com/imagemin/imagemin-webp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254301432,"owners_count":22047904,"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-08-04T14:00:55.346Z","updated_at":"2025-05-15T08:10:59.160Z","avatar_url":"https://github.com/imagemin.png","language":"JavaScript","funding_links":[],"categories":["目录"],"sub_categories":[],"readme":"# imagemin-webp ![GitHub Actions Status](https://github.com/imagemin/imagemin-webp/workflows/test/badge.svg?branch=main)\n\n\u003e WebP [imagemin](https://github.com/imagemin/imagemin) plugin\n\n## Install\n\n```sh\nnpm install imagemin-webp\n```\n\n## Usage\n\n```js\nimport imagemin from 'imagemin';\nimport imageminWebp from 'imagemin-webp';\n\nawait imagemin(['images/*.{jpg,png}'], {\n\tdestination: 'build/images',\n\tplugins: [\n\t\timageminWebp({quality: 50})\n\t]\n});\n\nconsole.log('Images optimized');\n```\n\n## API\n\n### imageminWebp(options?)(buffer)\n\nReturns a `Promise\u003cBuffer\u003e` with the optimized image.\n\n#### options\n\nType: `object`\n\n##### preset\n\nType: `string`\\\nDefault: `default`\n\nPreset setting, one of `default`, `photo`, `picture`, `drawing`, `icon` and `text`.\n\n##### quality\n\nType: `number`\\\nDefault: `75`\n\nSet quality factor between `0` and `100`.\n\n##### alphaQuality\n\nType: `number`\\\nDefault: `100`\n\nSet transparency-compression quality between `0` and `100`.\n\n##### method\n\nType: `number`\\\nDefault: `4`\n\nSpecify the compression method to use, between `0` (fastest) and `6` (slowest). This parameter controls the trade off between encoding speed and the compressed file size and quality.\n\n##### size\n\nType: `number`\n\nSet target size in bytes.\n\n##### sns\n\nType: `number`\\\nDefault: `50`\n\nSet the amplitude of spatial noise shaping between `0` and `100`.\n\n##### filter\n\nType: `number`\n\nSet deblocking filter strength between `0` (off) and `100`.\n\n##### autoFilter\n\nType: `boolean`\\\nDefault: `false`\n\nAdjust filter strength automatically.\n\n##### sharpness\n\nType: `number`\\\nDefault: `0`\n\nSet filter sharpness between `0` (sharpest) and `7` (least sharp).\n\n##### lossless\n\nType: `boolean | number`\\\nDefault: `false`\n\nEncode images losslessly. If set to a number, activates lossless preset with given level between `0` (fastest, larger files) and `9` (slowest, smaller files).\n\n##### nearLossless\n\nType: `number`\\\nDefault: `100`\n\nEncode losslessly with an additional [lossy pre-processing step](https://groups.google.com/a/webmproject.org/forum/#!msg/webp-discuss/0GmxDmlexek/3ggyYsaYdFEJ), with a quality factor between `0` (maximum pre-processing) and `100` (same as `lossless`).\n\n##### crop\n\nType: `object { x: number, y: number, width: number, height: number }`\n\nCrop the image.\n\n##### resize\n\nType: `object { width: number, height: number }`\n\nResize the image. Happens after `crop`.\n\n##### metadata\n\nType: `string | string[]`\\\nDefault: `none`\\\nValues: `all` `none` `exif` `icc` `xmp`\n\nA list of metadata to copy from the input to the output if present.\n\n#### buffer\n\nType: `Buffer`\n\nBuffer to optimize.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimagemin%2Fimagemin-webp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimagemin%2Fimagemin-webp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimagemin%2Fimagemin-webp/lists"}