我爱编程

淘宝镜NPM像源

2018-06-11  本文已影响36人  神木惊蛰

https://npm.taobao.org/

淘宝 NPM 镜像

这是一个完整 npmjs.org 镜像,你可以用此代替官方版本(只读),同步频率目前为 10分钟 一次以保证尽量与官方服务同步。

| 704,397 | 个模块 | 5,379,776 | 个模块版本 | 11 | 次删除 |
| 2,549,800 | 次本日下载 | 9,942,690 | 次本周下载 | 6,296,596 | 次本月下载 |
| 3,746,796 | 次昨日下载 | 29,323,541 | 次上周下载 | 122,095,178 | 次上月下载 |

同步状态

This registry will sync all packages from official registry.

上次同步完成时间: Wed May 02 2018 16:37:14 GMT+0800 (中国标准时间)

| 共 62 个模块需要同步 | 已完成 100% |
| 已同步完成了 62 个模块 | 其中 0 个模块同步失败 | 最近同步成功的模块是: uxi-cli |

Version Badge

Default style is flat-square.

Badge URL: https://npm.taobao.org/badge/v/cnpmjs.org.svg [图片上传失败...(image-baddc-1528704945144)]

使用说明

你可以使用我们定制的 cnpm (gzip 压缩支持) 命令行工具代替默认的 npm:

$ npm install -g cnpm --registry=https://registry.npm.taobao.org

或者你直接通过添加 npm 参数 alias 一个新命令:

alias cnpm="npm --registry=https://registry.npm.taobao.org \
--cache=$HOME/.npm/.cache/cnpm \
--disturl=https://npm.taobao.org/dist \
--userconfig=$HOME/.cnpmrc"

# Or alias it in .bashrc or .zshrc
$ echo '\n#alias for cnpm\nalias cnpm="npm --registry=https://registry.npm.taobao.org \
  --cache=$HOME/.npm/.cache/cnpm \
  --disturl=https://npm.taobao.org/dist \
  --userconfig=$HOME/.cnpmrc"' >> ~/.zshrc && source ~/.zshrc

安装模块

registry.npm.taobao.org 安装所有模块. 当安装的时候发现安装的模块还没有同步过来, 淘宝 NPM 会自动在后台进行同步, 并且会让你从官方 NPM registry.npmjs.org 进行安装. 下次你再安装这个模块的时候, 就会直接从 淘宝 NPM 安装了.

$ cnpm install [name]

同步模块

直接通过 sync 命令马上同步一个模块, 只有 cnpm 命令行才有此功能:

$ cnpm sync connect

当然, 你可以直接通过 web 方式来同步: /sync/connect

$ open https://npm.taobao.org/sync/connect

其它命令

支持 npm 除了 publish 之外的所有命令, 如:

$ cnpm info connect
上一篇 下一篇

猜你喜欢

热点阅读