node.js - 将参数/通配符定义为 npm 脚本键/名称的一部分
问题描述
我有一个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
解决方案
推荐阅读
- python - How to share a variable across modules in Kivy
- reactjs - Unanswered: React Native - Apply animation every-time component updates
- tcl - 如何在不选择每个项目的情况下获取 Tk 列表框的内容?
- javascript - 需要帮助传递值以发布表单
- ios - 使 UITableView 中的最后一行出现在顶部
- javascript - 获取事件:JavaScript 中的“聚焦”
- javascript - D3 折线图 - 添加线条交互性:如何获取 id 并选择每个线条?
- powershell - 更改我的 mp4 文件的创建日期时出错
- java - 恢复 WebView 状态
- django - 样式标签中的 Django 模板变量