gpt4 book ai didi

Node.js 和 npm : How can I create custom npm cli commands?

转载 作者:搜寻专家 更新时间:2023-10-31 22:26:46 25 4
gpt4 key购买 nike

例如,我经常使用 npm list -g -depth 0作为命令,我想用 npm listC 作为别名或 npm list -c1 .

我该怎么做?

最佳答案

您可以使用 npm scripts为自定义命令创建快捷方式。

在你的package.json你可能有:

{
"scripts": {
"listC": "npm list -g depth 0"
}
}

然后您可以使用 npm run listC 运行它.

关于Node.js 和 npm : How can I create custom npm cli commands?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36887021/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com