我知道如何使用以下方式在 JS 中检索命令行参数,
`Config.getTestArgs = () => {
try {
return global.commandLineArgs.args["test-args"];
}
catch (e) {
logger.error(`Error reading test - args from command line: ${ e } `);
return null;
}
};`
Run Code Online (Sandbox Code Playgroud)
当我在 Typescript 中使用相同的方式时,出现错误Cannot find module- global
如果我通过我的输入
`--build --test-args TestArument1`
Run Code Online (Sandbox Code Playgroud)
getTestArgs应返回 TestArgument1 作为输出。
考虑一下我们有自己的构建系统,它使用 NodeJs 和 Typescript。我应该考虑哪些 NodeJS 依赖项?