Socket
Book a DemoInstallSign in
Socket

then-array

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

then-array

Extra methods for promises for arrays

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

then-array

Extra methods for promises for arrays

Build Status Dependency Status NPM version

Installation

npm install then-array

API

ArrayPromise inherits the entire API of promise but all methods return instances of ArrayPromise where they would've returned instances of Promise. Those methods are:

  • ArrayPromise.from(value)
  • ArrayPromise.all(array) / Promise.all(a, b, c, ...)
  • ArrayPromise.denodeify(fn)
  • ArrayPromise.nodeify(fn)
  • ArrayPromise#then(onFulfilled, onRejected)
  • ArrayPromise#done(onFulfilled, onRejected)
  • ArrayPromise#nodeify(callback)

In addition, the following methods are provided with APIs that correspond to the Array equivallents but which support promises everywhere:

  • ArrayPromise#reverse() returns a promise for a new array with the elements reversed
  • ArrayPromise#concat(args...) if args are arrays or promises for arrays it will return a promise for all the arrays concatenated together.
  • ArrayPromise#slice(begin[, end]) return a promise for that portion of the array
  • ArrayPromise#map(fn) parallel, promised map
  • ArrayPromise#filter(fn) parallel, promised filter
  • ArrayPromise#reduce(fn[, initial]) promised reduce
  • ArrayPromise#reduceRight(fn[, initial]) promised reduceRight

License

MIT

FAQs

Package last updated on 04 Aug 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