{"id":20698863,"url":"https://github.com/rwson/auto-type-dep","last_synced_at":"2026-04-24T14:07:14.079Z","repository":{"id":40416375,"uuid":"254317885","full_name":"rwson/auto-type-dep","owner":"rwson","description":"a command to automatically fill up the @types corresponding to the dependency when you install a dependency","archived":false,"fork":false,"pushed_at":"2023-03-04T11:10:31.000Z","size":1058,"stargazers_count":2,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-11T03:41:58.042Z","etag":null,"topics":["js","nodejs","typescript"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rwson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-04-09T08:44:41.000Z","updated_at":"2022-05-09T08:09:09.000Z","dependencies_parsed_at":"2024-11-17T00:37:17.798Z","dependency_job_id":null,"html_url":"https://github.com/rwson/auto-type-dep","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rwson/auto-type-dep","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwson%2Fauto-type-dep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwson%2Fauto-type-dep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwson%2Fauto-type-dep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwson%2Fauto-type-dep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rwson","download_url":"https://codeload.github.com/rwson/auto-type-dep/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwson%2Fauto-type-dep/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32226464,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: 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":["js","nodejs","typescript"],"created_at":"2024-11-17T00:27:11.453Z","updated_at":"2026-04-24T14:07:14.063Z","avatar_url":"https://github.com/rwson.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"### auto-type-dep\n\n在平时用`TypeScript`开发项目时，如果我们安装一个包的同时没有把改包对应的`@types`装上的话，在导入的时候编辑器会发出警告，如果用`npm`或者`yarn`同时安装的话，又会安装在`dependencies`下面，逼死强迫症的节奏啊，所以就有了`auto-type-dep`，一键安装某个包和它的`@types`，分别安装在`dependencies`和`devDependencies`下面，使用起来也非常简单。\n\n`auto-type-dep`会自动从全局的`.npmrc`中读取配置的镜像, 默认使用淘宝`npm`源来安装依赖。\n\n#### usage\n\n- `[sudo] npm install auto-type-dep -g`把`auto-type-dep`安装成全局模块\n\n- `auto-type-dep add \u003cpkg1\u003e[@version] \u003cpkg2\u003e[@version] \u003cpkg3\u003e[@version] [option]` 安装(多个)npm包\n\n  安装相应的模块以及`@types`，如果在没有指定`-n`的情况下，判断项目中有没有`yarn.lock`文件，如果存在，就使用`yarn`安装，否则使用`npm`安装\n  @x.y.z可以指定具体版本号, 否则默认安装最新版本\n\n  | 参数       | 简写 | 作用                                       |\n  | -------- | ----- |  ---------------------------------------- |\n  | `--npm`  | `-n`  |  指定用`npm`进行安装                             |\n  | `--yarn` | `-y`  |  指定用`yarn`进行安装                            |\n  | `--js`   | `-js` | 指定当前项目是一个`javascript`项目，不需要安装对应的`@types` |\n\n- `auto-type-dep remove \u003cpkg1\u003e \u003cpkg2\u003e \u003cpkg3\u003e` 卸载(多个)npm包\n\n  卸载相应的模块以及`@types`，首先会判断项目中有没有`yarn.lock`文件，如果存在，就使用  `yarn`卸载，否则使用`npm`卸载\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frwson%2Fauto-type-dep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frwson%2Fauto-type-dep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frwson%2Fauto-type-dep/lists"}