首页 > 解决方案 > 在节点脚本中按顺序运行一组纱线命令

问题描述

我想按顺序使用纱线命令并在节点脚本中运行它,在中间步骤中,并根据需要将其与 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 as this is being done
}

以上是否可以在节点 js 或任何其他可用于节点项目的脚本中实现?

标签: node.jsyarnpkgyarnpkg-v2yarn-v2

解决方案


推荐阅读