@f/obj-to-promise

Convert an object to a promise.

Stats

StarsIssuesVersionUpdatedCreatedSize
@f/obj-to-promise
001.2.16 years ago6 years agoMinified + gzip package size for @f/obj-to-promise in KB

Readme

obj-to-promise

Build status Git tag NPM version Code style

Convert an object to a promise.

Installation

$ npm install @f/obj-to-promise

Usage

var objectToPromise = require('@f/obj-to-promise')

objectToPromise({
  1: Promise.resolve(1),
  2: Promise.resolve(2)
}).then(function (obj) {
  console.log(obj) // => { 1: 1, 2: 2 }
})

API

objectToPromise(object)

  • object - an object of "resolavables"

Returns: a promise

License

MIT

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.