{"id":13528347,"url":"https://github.com/mooyoul/node-webpinfo","last_synced_at":"2025-04-13T00:16:00.971Z","repository":{"id":35143330,"uuid":"138500596","full_name":"mooyoul/node-webpinfo","owner":"mooyoul","description":"Strongly-typed WebP Container Parser for Node.js","archived":false,"fork":false,"pushed_at":"2025-03-24T18:43:10.000Z","size":3211,"stargazers_count":16,"open_issues_count":27,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T00:15:52.600Z","etag":null,"topics":["animated-webp","image-processing","nodejs","stream","webp"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/mooyoul.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":"2018-06-24T17:08:23.000Z","updated_at":"2025-04-09T10:13:03.000Z","dependencies_parsed_at":"2024-04-06T03:26:06.336Z","dependency_job_id":"83012bad-93e9-4875-9cf4-58cc1aeb49af","html_url":"https://github.com/mooyoul/node-webpinfo","commit_stats":{"total_commits":248,"total_committers":4,"mean_commits":62.0,"dds":"0.21370967741935487","last_synced_commit":"28e645edf3615bcee11fcbf0f289e67652d88fec"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mooyoul%2Fnode-webpinfo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mooyoul%2Fnode-webpinfo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mooyoul%2Fnode-webpinfo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mooyoul%2Fnode-webpinfo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mooyoul","download_url":"https://codeload.github.com/mooyoul/node-webpinfo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248647273,"owners_count":21139086,"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":["animated-webp","image-processing","nodejs","stream","webp"],"created_at":"2024-08-01T06:02:27.103Z","updated_at":"2025-04-13T00:16:00.946Z","avatar_url":"https://github.com/mooyoul.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# node-webpinfo\n\n[![Build Status](https://github.com/mooyoul/node-webpinfo/workflows/workflow/badge.svg)](https://github.com/mooyoul/node-webpinfo/actions)\n[![Coverage Status](https://coveralls.io/repos/github/mooyoul/node-webpinfo/badge.svg?branch=master)](https://coveralls.io/github/mooyoul/node-webpinfo?branch=master)\n[![codecov.io](https://codecov.io/github/mooyoul/node-webpinfo/coverage.svg?branch=master)](https://codecov.io/github/mooyoul/node-webpinfo?branch=master)\n[![Semantic Release enabled](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n[![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com/)\n[![Known Vulnerabilities](https://snyk.io/test/github/mooyoul/node-webpinfo/badge.svg)](https://snyk.io/test/github/mooyoul/node-webpinfo)\n[![MIT license](http://img.shields.io/badge/license-MIT-blue.svg)](http://mooyoul.mit-license.org/)\n\nNode.js Stream based WebP Container Parser.\n\nnode-webpinfo [Example](https://github.com/mooyoul/node-webpinfo/blob/master/examples/webpinfo.ts) | webpinfo (libwebp) \n---------------- | ----------------\n![Output of node-webpinfo](https://raw.githubusercontent.com/mooyoul/node-webpinfo/master/examples/output-node-webpinfo.png) | ![Output of webpinfo](https://raw.githubusercontent.com/mooyoul/node-webpinfo/master/examples/output-libwebp-webpinfo.png)\n\n\n## Sponsor\n\n- [Vingle](https://www.vingle.net) - Vingle, Very Community. Love the things that you love. - [We're hiring!](https://careers.vingle.net/#/engineering/backend)\n\n\n## Install\n\n```bash\n$ npm install webpinfo\n```\n \n \n## Supported WebP Formats\n\n- Simple File Format (Lossy)\n- Simple File Format (Lossless)\n- Extended File Format (e.g. Animated WebP)\n\n## Supported WebP Chunks\n\n- VP8\n- VP8L\n- VP8X\n- ANIM\n- ANMF\n- ALPH\n- ICCP\n- EXIF\n- XMP\n    \n \n## Usage\n\n## Promise interface\n\n```typescript\nimport { WebPInfo } from \"webpinfo\";\n\n// local file path\nconst info = await WebPInfo.from(\"/some/local/file/path.webp\");\n// url\nconst info = await WebPInfo.from(\"https://example.com/some/file/path.webp\");\n// buffer\nconst info = await WebPInfo.from(buf);\n// readable stream\nconst info = await WebPInfo.from(fs.createReadStream(path));\nconsole.log(\"INFO: \", info);\n```\n\n## Stream interface\n\n```typescript\nimport * as http from \"http\";\nimport { WebPInfo } from \"webpinfo\";\n\nhttp.get(\"http://www.gstatic.com/webp/gallery/1.webp\", (res) =\u003e {\n  if (res.statusCode !== 200) {\n    console.log(\"unexpected status code: \", res.statusCode);\n    return;\n  }\n\n  res.pipe(new WebPInfo())\n    .on(\"error\", (e) =\u003e console.log(\"error\", e))\n    .on(\"riff\", (riff) =\u003e console.log(\"riff\", riff))\n    .on(\"chunk\", (chunk) =\u003e console.log(\"chunk\", chunk))\n    .on(\"format\", (format) =\u003e console.log(\"format\", format));\n});\n```\n\n## API\n\n### Please refer detailed type definitions on [src/webpinfo.ts](https://github.com/mooyoul/node-webpinfo/blob/4bb7fb281ac23b23ed74016463646ec0835f32f2/src/webpinfo.ts#L138-L237).\n\n### `WebPInfo` =\u003e [`WritableStream`](https://github.com/mooyoul/node-webpinfo/blob/4bb7fb281ac23b23ed74016463646ec0835f32f2/src/webpinfo.ts#L240)\n\nBasically WebPInfo is `WritableStream`.\n\n\n### `WebPInfo.from(input: string | Buffer | ReadableStream)` =\u003e [`Promise\u003cWebP\u003e`](https://github.com/mooyoul/node-webpinfo/blob/4bb7fb281ac23b23ed74016463646ec0835f32f2/src/webpinfo.ts#L223-L237)\n \nParse WebPInfo from given input.\nInput can be local file path, url, Buffer, or Readable Stream.\n\n\n### `WebPInfo.isAnimated(input: string | Buffer | ReadableStream)` =\u003e `Promise\u003cboolean\u003e`\n\nReturn true if given input contains any animation frame.\n\n### `WebPInfo.isLossless(input: string | Buffer | ReadableStream)` =\u003e `Promise\u003cboolean\u003e`\n\nReturn true if given buffer contains VP8L chunk.\n\n\n## Stream Events\n\n### `riff`\n\n- Event Payload: [`RIFFContainer`](https://github.com/mooyoul/node-webpinfo/blob/4bb7fb281ac23b23ed74016463646ec0835f32f2/src/webpinfo.ts#L69-L71)\n\nemitted after parsing riff header.\n\n\n### `chunk`\n\n- Event Payload: [`WebPChunk`](https://github.com/mooyoul/node-webpinfo/blob/4bb7fb281ac23b23ed74016463646ec0835f32f2/src/webpinfo.ts#L212-L221)\n\nemitted after parsing WebP chunk\n\n### `format`\n\n- Event Payload: [`WebP`](https://github.com/mooyoul/node-webpinfo/blob/4bb7fb281ac23b23ed74016463646ec0835f32f2/src/webpinfo.ts#L223-L237)\n\nemitted after all WebP chunks have parsed\n\n\n## Related\n\n- [mooyoul/is-webp-extended](https://github.com/mooyoul/is-webp-extended) - Extended version of `is-webp` package which supports Animated WebP. Compatible with Browser environment (e.g. `File`, `ArrayBuffer`)\n\n\n## Changelog\n\nSee [CHANGELOG](/CHANGELOG.md).\n\n\n## Debugging\n\nSet `DEBUG` environment variable to `webpinfo`.\nYou will be able to see debug messages on your console.\n\n\u003e $ env DEBUG='webpinfo' node your-app.js\n \n\n## Testing\n\n```bash\n$ npm run test\n```\n\n... OR\n\n```bash\n$ npm run lint # Check lint\n$ npm run coverage # Run test \u0026 generate code coverage report\n```\n\n\n## Build\n\n```bash\n$ npm run build\n```\n\n## License\n[MIT](LICENSE)\n\nSee full license on [mooyoul.mit-license.org](http://mooyoul.mit-license.org/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmooyoul%2Fnode-webpinfo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmooyoul%2Fnode-webpinfo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmooyoul%2Fnode-webpinfo/lists"}