@f/to-promise

Convert container to promise.

Stats

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

Readme

to-promise

Build status Git tag NPM version Code style

Convert container to promise.

Installation

$ npm install @f/to-promise

Usage

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

toPromise({
  a: Promise.resolve(1)
}).then(function (res) {
  res // => {a: 1}
})

toPromise([1]).then(function (res) {
  res // => [1]
})

API

toPromise(container)

  • container - A container of some kind to convert (array, object, generator, or thunk)

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.