ddxiami

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 2090|回复: 1

[文章] 淘宝 NPM 镜像

[复制链接]
发表于 2017-11-12 17:09:41 | 显示全部楼层 |阅读模式
原文地址:http://npm.taobao.org/

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

Version Badge
Default style is flat-square.
  • <0.1.0 & >=0.0.0:
  • <1.0.0 & >=0.1.0:
  • >=1.0.0:
使用说明
你可以使用我们定制的 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


回复

使用道具 举报

 楼主| 发表于 2017-11-12 17:10:14 | 显示全部楼层
npm install -g cnpm --registry=https://registry.npm.taobao.org
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|技术文档库 ( 闽ICP备15017263号-2 )|网站地图

GMT+8, 2025-5-19 01:14 , Processed in 0.036209 second(s), 16 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表