kisspromise

1.0.2 • Public • Published

KISS PROMISE

Motivation

This is a very simple, lightweight implementation of advanced promise features that extend built in promises

Features

  • Everything from Built in Promises
  • Static Methods:
    • Promise.map(array, callback) - Maps an array and returns it as a promise
    • Promise.each(array, callback) - Same as map but with only one parameter to the callback.
  • Member Methods:
    • map(callback) - Runs .then with the same callback function on each promise in the array of Promises. Eg: Promise.all(...).map
    • each(callback) - Same as .map, but with only one parameter passed. Useful for printing the result of each. Promise.all(...).each(console.log)
    • parallel(...callbacks) - Runs callbacks in parallel. Results are in an array similar to Promise.all
    • filter(callback) - Filters promises by callback

Readme

Keywords

none

Package Sidebar

Install

npm i kisspromise

Weekly Downloads

3

Version

1.0.2

License

MIT

Unpacked Size

1.81 kB

Total Files

3

Last publish

Collaborators

  • boboben1