@f/obj-to-promise

1.2.1 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i @f/obj-to-promise

Weekly Downloads

12

Version

1.2.1

License

MIT

Last publish

Collaborators

  • f