Skip to content
This repository has been archived by the owner on Apr 22, 2022. It is now read-only.
/ promise-utils Public archive

Set of utility functions to use when working with promises

Notifications You must be signed in to change notification settings

tagoro9/promise-utils

Repository files navigation

@tagoro9/promise-utils

This module is deprecated. Use tools like https://github.com/sindresorhus/p-series instead.

Set of utility functions to use when working with promises

Installation

yarn add @tagoro9/promise-utils

Or with npm

npm install @tagoro9/promise-utils

Usage

Import the functions that you want to use from the module

Functions

  • series. Execute an array of promise providers in series and return an array with the result of all promises
import {series} from '@tagoro9/promise-utils';
async function main() {
  const data = await series([
    () => Promise.resolve(1),
    () => Promise.resolve(2)
  ]); // [1, 2]
}