octopus-promise
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

Octopus

To get a trial of npm packaging process, it's published here.

Octopus can run a series of promises with a limitation.

Installation

Install it on your project.

npm install --save octopus-promise

Examples with Typescript

run all promises or async functions in an array

import OctoPus from 'octopus-promise';

let num = 0;
function* getItem(cnt: number) {
  for (let i = 0; i < cnt; i++) {
    yield i;
  }
}

await new OctoPus(getItem(10), {
  workers: 3,
  executor: async (i: number) => {
    num += i;
  },
}).execute();

/octopus-promise/

    Package Sidebar

    Install

    npm i octopus-promise

    Weekly Downloads

    2

    Version

    1.0.3

    License

    ISC

    Unpacked Size

    6.97 kB

    Total Files

    8

    Last publish

    Collaborators

    • yuefeng.niu