promise-share
Creates a getter function for a promise result
Last updated 7 years ago by zkochan .
MIT · Repository · Original npm · Tarball · package.json
$ npm install promise-share 
SYNC missed versions from official npm registry.

promise-share

Creates a getter function for a promise result

npm version

Helps to avoid UnhandledPromiseRejectionWarning. If you need to export a result as a promise, use this function to wrap the promise. When you'll need the result of the promise, run the function.

Installation

<pnpm|yarn|npm> add promise-share

Usage

'use strict'
const promiseShare = require('promise-share')

const file = promiseShare(readFileAsync())

console.log(await file())
//> file content

License

MIT © Zoltan Kochan

Current Tags

  • 2.0.1                                ...           latest (6 months ago)

3 Versions

  • 2.0.1                                ...           6 months ago
  • 2.0.0                                ...           9 months ago
  • 1.0.0                                ...           7 years ago
Maintainers (1)
Downloads
Total 14
Today 0
This Week 0
This Month 8
Last Day 0
Last Week 0
Last Month 5
Dependencies (1)
Dev Dependencies (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE