【发布时间】:2021-05-26 07:45:43
【问题描述】:
是否有可能在 package.json 文件中运行 scripts 命令而无需之前键入 yarn 或 npm?我的意思是我有类似的东西:
"scripts": {
"get": "node index.js"
}
所以要运行它,我必须输入yarn get [arguments]。有什么方法可以只输入get [arguments] 也可以吗?
【问题讨论】:
-
它只是一个 json 文件。您可以通过任何方式阅读它。蛋。 stedolan.github.io/jq,或来自诸如节点或 python 之类的程序。然后您可以将该命令通过管道传输到 shell 中。
-
您似乎想将模块安装为全局和use the
binfield -
它基本上只是我想通过终端的简单命令运行的 index.js 文件
标签: javascript node.js npm yarnpkg