promise-share
Creates a getter function for a promise result
Last updated 7 years ago by zkochan .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm 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

  • 1.0.0                                ...           latest (7 years ago)

1 Versions

  • 1.0.0                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (1)
Dev Dependencies (1)

Copyright 2013 - present © cnpmjs.org | Home |