npm-csr
快速切换 npm
源
🦕
动机 不想每次记住太长的镜像地址
🦖
使用 安装
npm i npm-csr -g
命令式
获取
# 获取当前源
npm-csr
切换 npm
# 切换为 npm 源
npm-csr npm
切换 cnpm
# 切换为 cnpm 源
npm-csr cnpm
编程式
const {
setNpmRegistry,
getCurrentNpmRegistry,
} = require("npm-csr");
// 切换为 npm 源
await setNpmRegistry("npm");
// 切换为 cnpm 源
await setNpmRegistry("cnpm");
// 获取当前 npm 源
await getCurrentNpmRegistry();
License
Made with markthree
Published under MIT License.