Skip to content

Commit 2ecfa86

Browse files
committed
docs: npm 命令行传参
1 parent a2034d7 commit 2ecfa86

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

npm/命令行传参.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## 命令行传参
2+
3+
使用 `--` 分隔 npm 自带的命令和自定义命令,形如:
4+
5+
`npm run dev -- name=test`
6+
7+
然后在 `process.argv` 里可以获取到 `name=test`。关于使用 `--` 的原因可以阅读这个 [issue](https://github.com/npm/npm/pull/5518)

0 commit comments

Comments
 (0)