package
Pull the value from a promise using pull-streams
npm install pull-promiseGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 2 packages.
89.2 kB
Includes dependencies.
Pull the value from a promise using pull-streams
$ npm install pull-promise.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$ npm test