We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
目前是借助了镜像网站的同步网页来触发同步,需要弹出浏览器,离开了命令行界面,体验不够顺畅。
调研同步接口,参考 cnpm sync 的源码,摆脱对浏览器的依赖,从而实现所有交互在命令行完成。
The text was updated successfully, but these errors were encountered:
感觉不需要看cnpm源码,我看了一下浏览器请求,同步的时候就是去请求了一个 https://registry-direct.npmmirror.com/[PKG_NAME]/sync?sync_upstream=true ,然后拿到一个logId,然后根据这个id轮训去请求https://registry-direct.npmmirror.com/[PKG_NAME]/sync/log/[logId] ,然后检查返回的syncDone字段,true则表示同步完成
logId
syncDone
true
因此,只需要发几个请求就可以了,也不需要打开浏览器了。
Sorry, something went wrong.
@champkeh 好的,谢谢提示!
哈哈,根据这个思路,我也写了一个自动同步的工具sync-npm-mirror
@champkeh 哈哈,不错不错,很荣幸能给你启发。
No branches or pull requests
背景
目前是借助了镜像网站的同步网页来触发同步,需要弹出浏览器,离开了命令行界面,体验不够顺畅。
计划
调研同步接口,参考 cnpm sync 的源码,摆脱对浏览器的依赖,从而实现所有交互在命令行完成。
The text was updated successfully, but these errors were encountered: