{"id":20105928,"url":"https://github.com/markthree/npm-csr","last_synced_at":"2025-03-02T17:47:02.734Z","repository":{"id":65522290,"uuid":"482543958","full_name":"markthree/npm-csr","owner":"markthree","description":"快速切换 npm 源","archived":false,"fork":false,"pushed_at":"2024-02-28T08:20:33.000Z","size":121,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-13T05:08:09.019Z","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/markthree.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":"2022-04-17T14:22:35.000Z","updated_at":"2024-02-28T08:19:24.000Z","dependencies_parsed_at":"2024-02-28T09:40:26.107Z","dependency_job_id":null,"html_url":"https://github.com/markthree/npm-csr","commit_stats":{"total_commits":21,"total_committers":1,"mean_commits":21.0,"dds":0.0,"last_synced_commit":"b5ebfa26a5f0abb6d6f8d57ce5202faa4d38da27"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":"markthree/node-lib-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markthree%2Fnpm-csr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markthree%2Fnpm-csr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markthree%2Fnpm-csr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markthree%2Fnpm-csr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markthree","download_url":"https://codeload.github.com/markthree/npm-csr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241549089,"owners_count":19980475,"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":[],"created_at":"2024-11-13T17:48:39.190Z","updated_at":"2025-03-02T17:47:02.714Z","avatar_url":"https://github.com/markthree.png","language":"JavaScript","readme":"# npm-csr\n\n该方案已废弃，请改用 [dnrm](https://github.com/markthree/dnrm)\n\n快速切换 `npm` 源\n\n\u003cbr /\u003e\n\n## 动机 🦕\n\n不想每次记住太长的镜像地址\n\n\u003cbr /\u003e\n\u003cbr /\u003e\n\n## 使用 🦖\n\n### 安装\n\n```shell\nnpm i npm-csr -g\n```\n\n\u003cbr /\u003e\n\n### 命令式\n\n#### 获取\n\n```shell\n# 获取当前源\nnpm-csr\n```\n\n#### 切换 npm\n\n```shell\n# 切换为 npm 源\nnpm-csr npm\n```\n\n#### 切换 cnpm\n\n```shell\n# 切换为 cnpm 源\nnpm-csr cnpm\n```\n\n\u003cbr /\u003e\n\n### 编程式\n\n```ts\nconst {\n  setNpmRegistry,\n  getCurrentNpmRegistry,\n} = require(\"npm-csr\");\n\n// 切换为 npm 源\nawait setNpmRegistry(\"npm\");\n\n// 切换为 cnpm 源\nawait setNpmRegistry(\"cnpm\");\n\n// 获取当前 npm 源\nawait getCurrentNpmRegistry();\n```\n\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n\n## License\n\nMade with [markthree](https://github.com/markthree)\n\nPublished under [MIT License](./LICENSE).\n\n\u003cbr /\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkthree%2Fnpm-csr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkthree%2Fnpm-csr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkthree%2Fnpm-csr/lists"}