{"id":40872361,"url":"https://github.com/wenzi0github/npm-webpack-ts","last_synced_at":"2026-01-22T00:41:48.278Z","repository":{"id":40766810,"uuid":"266823227","full_name":"wenzi0github/npm-webpack-ts","owner":"wenzi0github","description":"使用typescript开发npm包的模板","archived":false,"fork":false,"pushed_at":"2022-11-13T18:47:54.000Z","size":1666,"stargazers_count":5,"open_issues_count":12,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-27T09:09:47.311Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/wenzi0github.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":"2020-05-25T16:06:39.000Z","updated_at":"2023-04-22T20:06:44.000Z","dependencies_parsed_at":"2022-08-27T00:11:13.545Z","dependency_job_id":null,"html_url":"https://github.com/wenzi0github/npm-webpack-ts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wenzi0github/npm-webpack-ts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wenzi0github%2Fnpm-webpack-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wenzi0github%2Fnpm-webpack-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wenzi0github%2Fnpm-webpack-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wenzi0github%2Fnpm-webpack-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wenzi0github","download_url":"https://codeload.github.com/wenzi0github/npm-webpack-ts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wenzi0github%2Fnpm-webpack-ts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28648460,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T21:29:11.980Z","status":"ssl_error","status_checked_at":"2026-01-21T21:24:31.872Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":[],"created_at":"2026-01-22T00:41:48.212Z","updated_at":"2026-01-22T00:41:48.265Z","avatar_url":"https://github.com/wenzi0github.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 使用 typescript 开发 npm 包的配置模板\n\n## 背景介绍(Background)\n\n[![version](https://img.shields.io/npm/v/gh-qqnews-report?color=brightgreen\u0026style=flat-square)](https://www.npmjs.com/package/gh-qqnews-report)\n![size](https://img.shields.io/bundlephobia/min/gh-qqnews-report)\n\n在日常的工作中，经常会有重复性的功能，这里就可以提炼成为一个组件。那么如何将其提炼出来，并发布为 npm 包呢。这个仓库就是提供一个模板。\n\n这是一个纯 typescript 开发的 npm 包，没有 react 和 vue 等框架。\n\n这里的徽章标签可以去 [https://img.shields.io](https://img.shields.io) 生成。\n\n- 集成了 jest 的测试框架，可以直接在**\\_\\_tests\\_\\_**的目录编写测试样例。\n- 使用 prettier 进行格式化操作，并配合 tslint 进行格式化的检查\n- 采用 husky + commitlint 规范 git 的提交信息\n\n## 使用\n\n本模板的安装是从 git 仓库 clone 下来，然后安装 npm 包后，即可进行开发，开箱即用。\n\n### 下载：\n\n```shell\n$ git clone https://github.com/wenzi0github/npm-webpack-ts.git ./gh-qqnews-report\n```\n\n安装相应的 npm 包：\n\n```shell\n$ cd ./gh-qqnews-report\n$ npm install --save-dev\n```\n\n### 修改 package.json\n\n这里要修改配置文件中的信息了：\n\n```json\n{\n  \"name\": \"your project name\", // 修改为自己项目的英文名\n  \"version\": \"0.0.1\", // 版本号，建议从0.0.1开始\n  \"description\": \"这是一个干什么的仓库\", // 描述\n  \"main\": \"dist/index.js\", // 入口文件是哪个\n  \"types\": \"dist/index.d.ts\", // typescript的定义入口文件\n  \"repository\": \"https://github.com/wenzi0github/npm-webpack-ts.git\", // 自己仓库的地址\n  \"files\": [\"dist\"] // 要把哪些文件发布到npm上\n}\n```\n\n## readme 模板\n\n你可以按照以下的格式介绍你的仓库的功能。\n\n### 安装(Install)\n\n针对已经开发好的 npm 包，要介绍给用户时，可以这样介绍，我们以`gh-qqnews-report`包为例：\n\n使用 npm:\n\n```shell\n$ npm install gh-qqnews-report\n```\n\n使用 bower:\n\n```shell\n$ bower install gh-qqnews-report\n```\n\n使用 yarn:\n\n```shell\n$ yarn add gh-qqnews-report\n```\n\n使用 jsDelivr 的 CDN 地址:\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/gh-qqnews-report\"\u003e\u003c/script\u003e\n```\n\n使用 unpkg 的 CDN 地址:\n\n```html\n\u003cscript src=\"https://unpkg.com/gh-qqnews-report\"\u003e\u003c/script\u003e\n```\n\n### 使用方式(Usage)\n\n这里要提供先直接用一个简单的例子，介绍如何使用。\n\n```javascript\nconst report = new Report({\n  actid: 56, // 每个项目的actid均不相同，请向产品经理确认\n});\nreport.send({\n  pagename: \"mainpage\",\n  event_id: \"pv\",\n});\n```\n\n### 样例(example)\n\n更多详细的使用方法介绍。\n\n### 维护者(Maintainers)\n\n[wenzi0github](https://github.com/wenzi0github)\n\n### 贡献者(Contributing)\n\n无\n\n### 协议(License)\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwenzi0github%2Fnpm-webpack-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwenzi0github%2Fnpm-webpack-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwenzi0github%2Fnpm-webpack-ts/lists"}