文章目录
text
1
2
3
<a href="#markDown__3">markDown 生成带侧边栏的目录</a> <a href="#npm_21">设置npm源的几种方式</a>
<a href="#_23">原始源</a> <a href="#_nrm_30">方案: 使用nrm</a> <a href="#__62">方案: 改变全局的注册</a> <a href="#__88">方案: 在命令行里指定源</a> <a href="#__npmrc_94">方案: 修改 `~/.npmrc`</a> <a href="#_cnpm_100">方案: 使用cnpm</a>
每天用markdown写东西,[TOC]是生成顶部目录,如何生成左侧目录呢?记录下笔记
markDown 生成带侧边栏的目录
1.首先安装马克飞象
2.第二步安装 npm install -g i5ting_toc
3.进入 md 文件所在的文件夹后, 输入命令:
text
1
2
i5ting_toc -f sample.md -o
ample.md是你的文件名
此时你的桌面上就会出现一个preview的文件夹
记下点滴,等老了慢慢欣赏
设置npm源的几种方式
原始源
text
1
2
3
# the original source
https://registry.npmjs.org/
方案: 使用nrm
安装
text
1
2
npm install -g nrm
列出源的候选项
text
1
2
nrm ls
输出结果:
text
1
2
3
4
5
6
7
8
* npm -------- https://registry.npmjs.org/
yarn ------- https://registry.yarnpkg.com/
cnpm ------- http://r.cnpmjs.org/
taobao ----- https://registry.npm.taobao.org/
nj --------- https://registry.nodejitsu.com/
npmMirror -- https://skimdb.npmjs.com/registry/
edunpm ----- http://registry.enpmjs.org/
使用淘宝源
text
1
2
nrm use taobao
方案: 改变全局的注册
设置成淘宝源
text
1
2
npm config set registry https://registry.npm.taobao.org
查看结果
text
1
2
npm config get registry
输出结果:
text
1
2
https://registry.npm.taobao.org/
测试一下
text
1
2
npm info underscore
方案: 在命令行里指定源
text
1
2
npm --registry https://registry.npm.taobao.org install [name]
方案: 修改 ~/.npmrc
text
1
2
registry = https://registry.npm.taobao.org
方案: 使用cnpm
text
1
2
3
npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm install [name]
END