NPM2——文档阅读
# NPM文档
npm -h
打开帮助文档
npm install install all the dependencies in your project
npm install <foo> add the <foo> dependency to your project
npm test run this project's tests
npm run <foo> run the script named <foo>
npm <command> -h quick help on <command>
npm -l display usage info for all commands
npm help <term> search for help on <term> (in a browser)
npm help npm more involved overview (in a browser)
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
# 常用的就这些:
npm adduser Add a registry user account
npm init Create a package.json file
npm install Install a package
npm ls List installed packages
npm outdated Check for outdated packages
npm ping Ping npm registry
npm repo Open package repository page in the browser,例如把github仓库打开了
npm uninstall Remove a package
npm update Update packages
npm version Bump a package version
npm view View registry info //注意aliases: info, show, v
npm whoami Display npm username
// 运行 prune 命令,npm CLI 会读取 package.json,并将结果与项目的 /node_modules 目录进行对比,并打印出不在 package.json 之列的模块列表。
npm prune Remove extraneous packages,删除无关的包
npm config list [--json]
npm config set <key>=<value> [<key>=<value> ...]
npm config get [<key> [<key> ...]]
npm docs dayjs // 直接跳转到dayjs的官网查看文档
npm search jquery // 搜索包,会列出所有包
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22