{"id":21524017,"url":"https://github.com/likaia/gif-parser-web","last_synced_at":"2025-04-09T22:51:10.747Z","repository":{"id":57701265,"uuid":"496613502","full_name":"likaia/gif-parser-web","owner":"likaia","description":"在web前端项目内获取GIF图片时长、帧数等信息（可在任意一个基于JS开发的框架中运行）","archived":false,"fork":false,"pushed_at":"2022-05-26T14:12:38.000Z","size":194,"stargazers_count":32,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-18T16:57:53.432Z","etag":null,"topics":["gif-parse","javascript","typescript","web-gifparse"],"latest_commit_sha":null,"homepage":"","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/likaia.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}},"created_at":"2022-05-26T12:33:53.000Z","updated_at":"2025-03-07T09:25:37.000Z","dependencies_parsed_at":"2022-08-29T04:31:37.628Z","dependency_job_id":null,"html_url":"https://github.com/likaia/gif-parser-web","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/likaia%2Fgif-parser-web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/likaia%2Fgif-parser-web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/likaia%2Fgif-parser-web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/likaia%2Fgif-parser-web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/likaia","download_url":"https://codeload.github.com/likaia/gif-parser-web/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248125642,"owners_count":21051766,"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":["gif-parse","javascript","typescript","web-gifparse"],"created_at":"2024-11-24T01:20:20.596Z","updated_at":"2025-04-09T22:51:10.702Z","avatar_url":"https://github.com/likaia.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gif-parser-web · [![npm](https://img.shields.io/badge/npm-v1.0.5-2081C1)](https://www.npmjs.com/package/gif-parser-web) [![yarn](https://img.shields.io/badge/yarn-v1.0.5-F37E42)](https://yarnpkg.com/package/gif-parser-web) [![github](https://img.shields.io/badge/GitHub-depositary-9A9A9A)](https://github.com/likaia/gif-parser-web) [![](https://img.shields.io/github/issues/likaia/gif-parser-web)](https://github.com/likaia/gif-parser-web/issues) [![](\thttps://img.shields.io/github/forks/likaia/gif-parser-web)](``https://github.com/likaia/gif-parser-web/network/members) [![](\thttps://img.shields.io/github/stars/likaia/gif-parser-web)](https://github.com/likaia/gif-parser-web/stargazers)\n\n## 写在前面\n关于此插件的更多介绍以及实现原理请移步👉：[JS获取GIF总帧数](https://www.kaisir.cn/post/142)\n\n## 插件安装\n```bash\n# yarn安装\nyarn add gif-parser-web\n\n# npm安装\nnpm install gif-parser-web --save\n```\n\n## 插件使用\n由于插件采用原生js编写且不依赖任何第三方库，因此它可以在任意一台支持js的设备上运行。\n\n### import形式使用插件\n* 在需要获取Gif图像信息的业务代码中导入插件\n```javascript\nimport GifParse from \"gif-parser-web\";\n```\n* 在业务代码中使用时实例化插件，调用对应的方法即可\n```javascript\nconst gifParse = new GifParse(\"插件支持传入一个图像url作为可选参数\");\nconst gifInfo = gifParse.getInfo(\"此处支持File类型的数据作为可选参数，如果传入则使用此处的参数作为gif数据源\");\ngifInfo.then((res)=\u003e{\n  console.log(\"解析完成\", res);\n})\n```\n\n### cdn形式使用插件\n* 将插件的`dist`文件夹复制到你的项目中\n* 使用`script`标签引入dist目录下的`gifParserPlugin.umd.js`文件\n```javascript\n\u003cscript src=\"./gifParserPlugin.umd.js\"\u003e\u003c/script\u003e\n```\n* 在业务代码中使用时实例化插件，调用对应的方法即可\n```javascript\nconst gifParse = new gifParserPlugin(\"插件支持传入一个图像url作为可选参数\");\nconst gifInfo = gifParse.getInfo(\"此处支持File类型的数据作为可选参数，如果传入则使用此处的参数作为gif数据源\");\ngifInfo.then((res)=\u003e{\n  console.log(\"解析完成\", res);\n})\n```\n\u003e 注意⚠️：GitHub中是不会上传dist目录的，你想要自己将项目clone到本地，编译得到dist文件夹。\n\u003e \n\u003e当然，你也可以直接下载[gifParserPlugin.umd.js](https://unpkg.com/gif-parser-web@1.0.5/dist/gifParserPlugin.umd.js)文件来使用\n\n\n## 写在最后\n至此，插件的使用方法就介绍完了。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flikaia%2Fgif-parser-web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flikaia%2Fgif-parser-web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flikaia%2Fgif-parser-web/lists"}