{"id":17584732,"url":"https://github.com/cssmagic/npm-mirror-sync","last_synced_at":"2025-04-28T16:23:09.348Z","repository":{"id":57687890,"uuid":"493524621","full_name":"cssmagic/npm-mirror-sync","owner":"cssmagic","description":"A CLI tool to make Taobao's npm mirror sync your package immediately.","archived":false,"fork":false,"pushed_at":"2022-05-20T03:48:16.000Z","size":6,"stargazers_count":11,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-20T11:07:16.629Z","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/cssmagic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-05-18T05:42:29.000Z","updated_at":"2024-07-29T02:00:42.000Z","dependencies_parsed_at":"2022-08-25T15:40:10.457Z","dependency_job_id":null,"html_url":"https://github.com/cssmagic/npm-mirror-sync","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cssmagic%2Fnpm-mirror-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cssmagic%2Fnpm-mirror-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cssmagic%2Fnpm-mirror-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cssmagic%2Fnpm-mirror-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cssmagic","download_url":"https://codeload.github.com/cssmagic/npm-mirror-sync/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251343196,"owners_count":21574325,"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-10-22T02:07:53.874Z","updated_at":"2025-04-28T16:23:09.328Z","avatar_url":"https://github.com/cssmagic.png","language":"JavaScript","readme":"# npm-mirror-sync\n\n\u003e A CLI tool to make Taobao's npm mirror sync your package immediately.\n\u003e\n\u003e 让淘宝的 NPM 镜像立即收录你的包的新版本。\n\n## 背景\n\n相信国内小伙伴都在用淘宝的 NPM 镜像（[npmmirror.com](https://npmmirror.com/)）作为安装源，速度确实更快。不过有时候也会有一个小烦恼——我自己维护的包发布到 NPM 官方仓库后，镜像仓库并不会立刻同步，可能要等好几分钟才能生效。\n\n幸好淘宝 NPM 镜像提供了一个同步网页，我们可以通过它来手动同步指定的包。于是我写了这个命令行工具来简化这个操作。小巧快捷，简单易用，相信你也用得到。\n\n\n## 使用方法\n\n1. 全局安装这个包 \u003csup\u003e[注]\u003c/sup\u003e：\n\n\t```sh\n\tnpm i -g npm-mirror-sync\n\t```\n\n1. 在你的包里为 `package.json` 添加如下脚本：\n\n\t```json\n\t{\n\t\t\"scripts\": {\n\t\t\t\"postpublish\": \"npx npm-mirror-sync\"\n\t\t}\n\t}\n\t```\n\n1. 这样就可以了。以后每次发布新版后，这个脚本就会自动打开淘宝 NPM 镜像的同步网页，让你发的新版立即生效。\n\n\u003e \u003csup\u003e[注]\u003c/sup\u003e 其实这一步并不是必须的，因为 npx 可以自动安装本地不存在的包。但从 npm@7 开始，npx 在自动安装包时需要用户在命令行手动确认，体验并不顺畅，因此还是建议先全局安装。资深用户自行取舍吧。\n\n***\n\n## License\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcssmagic%2Fnpm-mirror-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcssmagic%2Fnpm-mirror-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcssmagic%2Fnpm-mirror-sync/lists"}