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

seqprom

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

seqprom

Wrap and run promises in order (not at once)

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-75%
Maintainers
1
Weekly downloads
 
Created
Source

sequentialpromises

Circle CI

Wrap and run promises in order (not at once) Like Q.all() but functions will run one after the other

Usage

Install

npm install --save seqprom

Create the seqprom object by passing in the function you need to loop through

var Seqprom = require('seqprom');

//we want to call this function sequentially
function wrapMe(arg1, arg2){
    var deferred = Q.defer();

    setTimeout(function(){
        deferred.resolve(arg1 + arg2);
    }, 200)
    
    return deferred.promise;
}

//Wrap it
var wrappedSeqProm = new Seqprom(wrapMe);

//What we want to call it with
for(var i = 0; i < 10; i++){
	wrappedSeqProm.queueCall(i, i+1);
}

//run it
wrappedSeqProm.run()
	.then(function(results){
		//results[0] === 1
		//results[1] === 2
		//...etc
	});

FAQs

Package last updated on 10 Apr 2015

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