npm run-script
运行任意包脚本
概要
npm run-script <command> [--silent] [-- <args>...]
alias: npm run
描述
这会从包的 "scripts"
对象运行任意命令。如果没有提供 "command"
,它将列出可用的脚本。run[-script]
由 test、start、restart 和 stop 命令使用,但也可以直接调用。当包中的脚本被打印出来时,它们被分为生命周期(测试、启动、重启)和直接运行的脚本。
从 npm@2.0.0
开始,您可以在执行脚本时使用自定义参数。getopt 使用特殊选项 --
来分隔选项的结尾。npm 会将 --
之后的所有参数直接传递给您的脚本:
npm run test -- --grep="pattern"
参数只会传递给 npm run
之后指定的脚本,而不是任何 pre 或 post 脚本。
env
脚本是一个特殊的内置命令,可用于列出脚本在运行时可用的环境变量。如果您的包中定义了 "env" 命令,它将优先于内置命令。
8Gpq55a7RvHAA0OK99ResNjtGOTmR2ve863bkpCoBINTCEz8gPAMFxTHzOAAG11mPk2Q9gW+3r5XyiQxrNi/Gq3bJuuJE6PaE1KZQwODTdUjuQJFFhPHZFUqOknJ9G8jQgmdN2FNzDK734U8Y9c9qjkw1Lu9ZeIvOX7Bevwhwu9oEzYhwfSy6RVPHfMUfqLIsMkbPSjDjw0PRO3TS3iPinVaoOxcS3zvzJqJxplQQywCWtcQWGxrf/FszkQ0+TJGI+6cvBp/OlkMZ7A0GzT2SAt328XTCRTLC4jxwN9K0vq+MZRkYsLDK1oi/k2+eSfe9G1C1H85SYSx9a+MoFB3lefU6agpcU/Es8hXDxwfETdv1G8r9P9t6EvNQSbl/dcRXG5srgWEEnpStTxV1q8X6yLmNaUYummz8IxkJrTK5xVbozMEhC4eQ3JzYnN44zxyvDearpCip3ODjNFSMAFcoZc1IW2ZrCYMLe7SCePWkaOKvHueTlogWHEgUOQWFjoiwu+cpg5Hp3y+bzIwTE/mPdByHerjIT3kt8f5MKUvEEk=
"scripts": {"test": "tap test/\*.js"}
6Tjc/lkpIFNvHrZPi2DX0w==
"scripts": {"test": "node_modules/.bin/tap test/\*.js"}
Xu6Vkuglz4OWfj867g7UxsrIoea/ajj1GFVquPY7G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