New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

commands-queue

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

commands-queue

execute command line in a queue

0.0.3
latest
npm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

commands-queue

execute command line in a synchronized fashion

  • concurrently
  • in a concurrent sized queue
  • serially
npm install --save commands-queue

The following example execute all given commands in a concurrent queue of size 2:

const CommandQueue = require('commands-queue')
const queue = new CommandQueue({concurrency: 2})
queue.exec('cd project1 && npm install && npm run build && npm test')
queue.exec('cd project2 && npm install && npm run build && npm test')
queue.exec('cd project3 && npm install && npm run build && npm test').then(result=>console.log('echo "almost there", exit code: '+result.code))
queue.exec('cd project4 && npm install && npm run build && npm test')

Or similar to above but this time registering all the commands first and then start executing them programmatically:

(TODO)

const CommandQueue = require('commands-queue')
const queue = new CommandQueue({concurrency: 2, autoStart: false})
queue.exec('cd project1 && npm install && npm run build && npm test')
queue.exec('cd project2 && npm install && npm run build && npm test')
queue.exec('cd project3 && npm install && npm run build && npm test').then(console.log('echo "almost there"'))
queue.exec('cd project4 && npm install && npm run build && npm test')
queue.onIdle().then(()=>console.log('ALL WORK DONE'))
const results = await queue.start()

Documentation

API docs

FAQs

Package last updated on 17 Sep 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts