JSPM

pull-promise

2.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q21077F
  • License MIT

Pull the value from a promise using pull-streams

Package Exports

  • pull-promise
  • pull-promise/through

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (pull-promise) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

pull-promise

Pull the value from a promise using pull-streams

build status npm version dependency status license code style: standard

Installation

$ npm install pull-promise

API

.source(Promise)

Also available as require('pull-promise/source')

Creates a source stream with the resolved promise value.

const toPull = require('pull-promise')
// or -> const source = require('pull-promise/source')

pull(
  toPull.source(Promise.resolve(5)),
  pull.log()
)
// -> 5

.through(Promise)

Also available as require('pull-promise/through')

Creates a through stream with the resolved promise value as output.

const toPull = require('pull-promise')

const delay = (delay) => new Promise((resolve) => setTimeout(resolve, delay))

pull(
  pull.values([Date.now()]),
  toPull.through(delay(500)),
  pull.log()
)
// -> date after 500ms

Run tests

$ npm test 

License

MIT