我有一个 package.json
定义如下:
{
"name": "example",
"version": "1.0.0",
"description": "example",
(...)
"scripts": {
"something:special": "script-that-does-something.sh",
(...)
},
(...)
}
script-that-does-something.sh
获取一个参数来做某事,这意味着我通常会做类似的事情:
npm run something:special ARGUMENT
上面的代码非常好并且可以工作,但我想知道我是否可以在 package.json
中定义脚本以便能够在运行 的同时使用任何参数npm
命令如下:
npm run something:special:ARGUMENT
最佳答案
我也在寻找一种方法来避免为我的测试和命令编写每个脚本。
至少它会迫使你做一些好的文档。
https://stackoverflow.com/questions/58092574/
相关文章:
python - 如何使用 Pandas 计算数据框中的类标签频率?
spring-boot - 将实体与 OneToMany 和 HATEOAS RessourceAs
oauth-2.0 - 松弛 Oauth : Automatically authorize use
c# - OmniSharp MSBuild ProjectManager 无法更新我的 .cspr
postgresql - 如何为 linux、Fedora 安装 psycopg2
asynchronous - 如何使 promise 因 clojure 错误而失败?