{"id":26365452,"url":"https://github.com/biaov/stats-utils","last_synced_at":"2026-02-14T18:32:04.953Z","repository":{"id":196791836,"uuid":"696547843","full_name":"biaov/stats-utils","owner":"biaov","description":"一个用于展示统计数据的工具 😀","archived":false,"fork":false,"pushed_at":"2025-01-14T06:52:21.000Z","size":2543,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-05T01:33:10.606Z","etag":null,"topics":["github-statistics","node","tool","vite"],"latest_commit_sha":null,"homepage":"https://github.com/biaov/stats-utils","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/biaov.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":"2023-09-26T01:05:45.000Z","updated_at":"2025-01-14T06:51:46.000Z","dependencies_parsed_at":"2024-05-22T10:59:09.828Z","dependency_job_id":null,"html_url":"https://github.com/biaov/stats-utils","commit_stats":null,"previous_names":["biaov/github-statistics","biaov/stats-utils"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/biaov/stats-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biaov%2Fstats-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biaov%2Fstats-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biaov%2Fstats-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biaov%2Fstats-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/biaov","download_url":"https://codeload.github.com/biaov/stats-utils/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biaov%2Fstats-utils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29452371,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T15:52:44.973Z","status":"ssl_error","status_checked_at":"2026-02-14T15:52:11.208Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["github-statistics","node","tool","vite"],"created_at":"2025-03-16T19:37:05.283Z","updated_at":"2026-02-14T18:32:04.939Z","avatar_url":"https://github.com/biaov.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# stats-utils\r\n\r\n一个用于展示统计数据的工具 😀\r\n\r\n\u003ch2 align=\"center\"\u003e\r\n  \u003ca href=\"https://github.com/biaov/stats-utils\"\u003e\u003cimg src=\"https://shields.io/github/v/release/biaov/stats-utils.svg?logo=github\u0026label=version\" alt=\"version\" /\u003e\u003c/a\u003e\r\n  \u003ca href=\"https://github.com/biaov/stats-utils/blob/main/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-green\" alt=\"license\" /\u003e\u003c/a\u003e\r\n\u003c/h2\u003e\r\n\r\n## 特性\r\n\r\n- [x] [获取近 30 天内的 Github 仓库贡献记录](#获取近-30-天内的-github-仓库贡献记录)\r\n- [x] [根据文本生成 SVG 图片](#根据文本生成-svg-图片)\r\n- [x] [CSDN 统计面板](#csdn-统计面板)\r\n- [x] [NPM 包下载量统计](#npm-包下载量统计)\r\n\r\n## 使用\r\n\r\n### 获取近 30 天内的 Github 仓库贡献记录\r\n\r\n- `https://stats-utils.vercel.app/github-stats?username=[用户名]`\r\n- 案例：`https://stats-utils.vercel.app/github-stats?username=biaov`\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003e👀 点击查看 JSON 数据\u003c/summary\u003e\r\n\r\n```json\r\n{\r\n  \"contributions\": [\r\n    {\r\n      \"contributionCount\": 3,\r\n      \"date\": \"2023-08-28\"\r\n    },\r\n    {\r\n      \"contributionCount\": 3,\r\n      \"date\": \"2023-08-29\"\r\n    },\r\n    {\r\n      \"contributionCount\": 3,\r\n      \"date\": \"2023-08-30\"\r\n    },\r\n    {\r\n      \"contributionCount\": 3,\r\n      \"date\": \"2023-08-31\"\r\n    },\r\n    {\r\n      \"contributionCount\": 10,\r\n      \"date\": \"2023-09-01\"\r\n    },\r\n    {\r\n      \"contributionCount\": 39,\r\n      \"date\": \"2023-09-02\"\r\n    },\r\n    {\r\n      \"contributionCount\": 3,\r\n      \"date\": \"2023-09-03\"\r\n    },\r\n    {\r\n      \"contributionCount\": 3,\r\n      \"date\": \"2023-09-04\"\r\n    },\r\n    {\r\n      \"contributionCount\": 5,\r\n      \"date\": \"2023-09-05\"\r\n    },\r\n    {\r\n      \"contributionCount\": 4,\r\n      \"date\": \"2023-09-06\"\r\n    },\r\n    {\r\n      \"contributionCount\": 3,\r\n      \"date\": \"2023-09-07\"\r\n    },\r\n    {\r\n      \"contributionCount\": 11,\r\n      \"date\": \"2023-09-08\"\r\n    },\r\n    {\r\n      \"contributionCount\": 3,\r\n      \"date\": \"2023-09-09\"\r\n    },\r\n    {\r\n      \"contributionCount\": 3,\r\n      \"date\": \"2023-09-10\"\r\n    },\r\n    {\r\n      \"contributionCount\": 20,\r\n      \"date\": \"2023-09-11\"\r\n    },\r\n    {\r\n      \"contributionCount\": 16,\r\n      \"date\": \"2023-09-12\"\r\n    },\r\n    {\r\n      \"contributionCount\": 20,\r\n      \"date\": \"2023-09-13\"\r\n    },\r\n    {\r\n      \"contributionCount\": 4,\r\n      \"date\": \"2023-09-14\"\r\n    },\r\n    {\r\n      \"contributionCount\": 5,\r\n      \"date\": \"2023-09-15\"\r\n    },\r\n    {\r\n      \"contributionCount\": 3,\r\n      \"date\": \"2023-09-16\"\r\n    },\r\n    {\r\n      \"contributionCount\": 3,\r\n      \"date\": \"2023-09-17\"\r\n    },\r\n    {\r\n      \"contributionCount\": 22,\r\n      \"date\": \"2023-09-18\"\r\n    },\r\n    {\r\n      \"contributionCount\": 6,\r\n      \"date\": \"2023-09-19\"\r\n    },\r\n    {\r\n      \"contributionCount\": 16,\r\n      \"date\": \"2023-09-20\"\r\n    },\r\n    {\r\n      \"contributionCount\": 3,\r\n      \"date\": \"2023-09-21\"\r\n    },\r\n    {\r\n      \"contributionCount\": 6,\r\n      \"date\": \"2023-09-22\"\r\n    },\r\n    {\r\n      \"contributionCount\": 3,\r\n      \"date\": \"2023-09-23\"\r\n    },\r\n    {\r\n      \"contributionCount\": 0,\r\n      \"date\": \"2023-09-24\"\r\n    },\r\n    {\r\n      \"contributionCount\": 20,\r\n      \"date\": \"2023-09-25\"\r\n    },\r\n    {\r\n      \"contributionCount\": 5,\r\n      \"date\": \"2023-09-26\"\r\n    },\r\n    {\r\n      \"contributionCount\": 3,\r\n      \"date\": \"2023-09-27\"\r\n    }\r\n  ],\r\n  \"name\": \"biaov\"\r\n}\r\n```\r\n\r\n\u003c/details\u003e\r\n\r\n### 根据文本生成 SVG 图片\r\n\r\n- `https://stats-utils.vercel.app/svg?text=[自定义文本]`\r\n- ![案例](https://stats-utils.vercel.app/svg?text=案例)\r\n\r\n```md\r\n![案例](https://stats-utils.vercel.app/svg?text=案例)\r\n```\r\n\r\n#### Query 参数\r\n\r\n| 名称  | 描述                                                 | 类型   | 默认值   |\r\n| ----- | ---------------------------------------------------- | ------ | -------- |\r\n| text  | 文本内容                                             | string | --       |\r\n| size  | 文本字体大小, 单位像素                               | number | `34`     |\r\n| color | 文本颜色, 支持 16 进制, 自带 `#`, 或者 `rgb`, `rgba` | string | `f56c6c` |\r\n\r\n### CSDN 统计面板\r\n\r\n```md\r\n![CSDN 数据](https://stats-utils.vercel.app/csdn/biao_feng)\r\n```\r\n\r\n- [![CSDN 数据](https://stats-utils.vercel.app/csdn/biao_feng)](https://blog.csdn.net/biao_feng)\r\n\r\n#### Query 参数\r\n\r\n| 名称       | 描述                                                 | 类型   | 默认值      |\r\n| ---------- | ---------------------------------------------------- | ------ | ----------- |\r\n| color      | 文本颜色, 支持 16 进制, 自带 `#`, 或者 `rgb`, `rgba` | string | `38bdae`    |\r\n| background | 背景颜色, 支持 16 进制, 自带 `#`, 或者 `rgb`, `rgba` | string | `1a1b27`    |\r\n| title      | 标题内容                                             | string | `CSDN 数据` |\r\n| titleColor | 标题颜色, 支持 16 进制, 自带 `#`, 或者 `rgb`, `rgba` | string | `70a5fd`    |\r\n\r\n### NPM 包下载量统计\r\n\r\n```md\r\n![包名](https://stats-utils.vercel.app/downloads/包名)\r\n```\r\n\r\n- ![mine-h5-ui](https://stats-utils.vercel.app/downloads/mine-h5-ui)\r\n\r\n#### Query 参数\r\n\r\n| 名称       | 描述         | 类型   | 可选值                                   | 默认值           |\r\n| ---------- | ------------ | ------ | ---------------------------------------- | ---------------- |\r\n| color      | 下载量背景色 | string | --                                       | `4c1`            |\r\n| label      | 标注         | string | --                                       | `downloads`      |\r\n| labelColor | 标注背景色   | string | --                                       | `555`            |\r\n| start      | 统计开始时间 | string | --                                       | 当前日期往前一年 |\r\n| end        | 统计结束时间 | string | --                                       | 当前日期         |\r\n| icon       | 图标名称     | string | [simple-icons](https://simpleicons.org/) | --               |\r\n| svg        | 是否返回 svg | string | true / false                             | `true`           |\r\n\r\n## 项目运行\r\n\r\n### 安装依赖\r\n\r\n- 运行以下命令安装依赖时, 会自动创建 `.env.development` 环境变量文件\r\n\r\n```sh\r\nnpm i\r\n```\r\n\r\n### 运行项目\r\n\r\n```sh\r\nnpm start\r\n```\r\n\r\n### 打包项目\r\n\r\n```sh\r\nnpm run build\r\n```\r\n\r\n### 命名规范\r\n\r\n- 短横线命名(kebab-case): 文件名\r\n- 帕斯卡命名(PascalCase, 大驼峰命名: CamelCase): 枚举命名, 类型命名, 类命名\r\n- 小驼峰命名(camelCase): 变量命名\r\n\r\n### 技术栈\r\n\r\n- `Vite` + `TS` + `NodeJs` + `Express`\r\n\r\n### 依赖特性\r\n\r\n#### dependencies\r\n\r\n- `axios`: 网络请求工具\r\n- `canvas`: 位图工具\r\n- `dayjs`: 时间处理工具\r\n- `dom-parser`: 解析 HTML\r\n- `express`: Node 开发框架\r\n- `simple-icons`: [icon 图标库](https://simpleicons.org/)\r\n\r\n#### devDependencies\r\n\r\n- `@types/express`: `express` 的类型\r\n- `@types/node`: `node` 的类型\r\n- `terser`: 压缩代码\r\n- `typescript`: 编程语言\r\n- `vite`: 项目构建工具\r\n- `vite-plugin-node`: vite 插件, 开启 Node.js 服务器\r\n\r\n## 贡献者们\r\n\r\n[![贡献者们](https://contrib.rocks/image?repo=biaov/stats-utils)](https://github.com/biaov/stats-utils/graphs/contributors)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiaov%2Fstats-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbiaov%2Fstats-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiaov%2Fstats-utils/lists"}