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

array-series

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

array-series

Call an array of asynchronous functions in series

  • 0.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
329K
decreased by-3.91%
Maintainers
1
Weekly downloads
 
Created

What is array-series?

The array-series npm package allows you to run an array of asynchronous functions in series, meaning one after the other, where each function waits for the previous one to complete before starting.

What are array-series's main functionalities?

Run asynchronous functions in series

This feature allows you to run an array of asynchronous functions in series. Each function in the array takes a callback function as its argument, which it calls when it has completed its task. The next function in the array will not start until the previous one has called its callback.

const series = require('array-series');

const tasks = [
  function (done) {
    setTimeout(function () {
      console.log('Task 1');
      done();
    }, 1000);
  },
  function (done) {
    setTimeout(function () {
      console.log('Task 2');
      done();
    }, 500);
  },
  function (done) {
    setTimeout(function () {
      console.log('Task 3');
      done();
    }, 100);
  }
];

series(tasks, function (err) {
  if (err) throw err;
  console.log('All tasks completed');
});

Other packages similar to array-series

FAQs

Package last updated on 15 Apr 2013

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