Node.js 在节点脚本中按顺序运行一组命令
我想按顺序使用Thread命令,并在中间步骤中在节点脚本中运行它,然后根据需要将其与js混合使用。比如说Node.js 在节点脚本中按顺序运行一组命令,node.js,yarnpkg,yarnpkg-v2,yarn-v2,Node.js,Yarnpkg,Yarnpkg V2,Yarn V2,我想按顺序使用Thread命令,并在中间步骤中在节点脚本中运行它,然后根据需要将其与js混合使用。比如说 yarn audit > out.json //some file reading, processing, and storage for(i = 0; i < libs.length; i++) { yarn add lib1@v1.1.1 //need to run this in a loop //print the console output a
yarn audit > out.json
//some file reading, processing, and storage
for(i = 0; i < libs.length; i++) {
yarn add lib1@v1.1.1 //need to run this in a loop
//print the console output as this is being done
}
warn audit>out.json
//一些文件读取、处理和存储
对于(i=0;i
在node js或可用于node项目的任何其他脚本中是否可能出现上述情况?我尝试过这一建议,但效果不好,很快就会退出或出现错误。您可以使用
子进程执行命令