diff --git a/docs/npm.html b/docs/npm.html index 7df5d674..f9350d06 100644 --- a/docs/npm.html +++ b/docs/npm.html @@ -42,7 +42,7 @@

这个 npm 快速参考备忘单显示了它的常用命令使用清单

常用命令

包管理

@@ -287,6 +287,57 @@ # 将注册表切换到 cnpm $ nrm use cnpm +

init

+

用于设置新的或现有的 npm

+
$ npm init <package-spec> # (如同 `npx <package-spec>)
+$ npm init <@scope>       # (如同 `npx <@scope>/create`)
+
+

别名: create, innit

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
:---
npm init foonpm exec create-foo
npm init @usr/foonpm exec @usr/create-foo
npm init @usrnpm exec @usr/create
npm init @usr@2.0.0npm exec @usr/create@2.0.0
npm init @usr/foo@2.0.0npm exec @usr/create-foo@2.0.0
+ +

exec

+

命令允许您在与通过 npm run 运行它类似的上下文中从 npm 包

+
$ npm exec -- <pkg>[@<version>] [args...]
+$ npm exec --package=<pkg>[@<version>] -- <cmd> [args...]
+$ npm exec -c '<cmd> [args...]'
+$ npm exec --package=foo -c '<cmd> [args...]'
+
+

别名: x

+
$ npm exec --package yo --package generator-node --call "yo node"
+
+$ npm exec --package=foo -- bar --bar-argument
+# ~ or ~
+$ npx --package=foo bar --bar-argument
+

npx

介绍

从本地或远程 npm 包运行命令

diff --git a/index.html b/index.html index e6accdb4..b93ccfee 100644 --- a/index.html +++ b/index.html @@ -498,6 +498,9 @@ onewesong + + partoneplay + ryanhex53