Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

exec-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

exec-queue

Safely run exec in a loop.

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
111
decreased by-9.76%
Maintainers
1
Weekly downloads
 
Created
Source

#Exec Queue Safely run exec in a loop.

I ran into an Error: spawn EMFILE when trying to call exec too many times (ie. in a loop). This module safely packages exec so that you may use it in a loop without creating too many child processes.

##Usage npm install exec-queue

var exec = require('exec-queue');
for (var i = 0; i < 100; ++i) {
  exec('ls', function (err, stdout, stderr) {
    console.log(stdout);
  });
}

Try the above example with require('child_process').exec instead. ;)

The current limit is 10 child processes running simultaneously. I did not test the limit (maybe it can be queried by OS). If you need more, please file an issue, as I could add to the API to be able to specify the limit.

Keywords

FAQs

Package last updated on 22 Jan 2014

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc