1.1.0 • Published 7 years ago

ensure-bluebird v1.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

ensureBluebird

Ensure that all returned promises are bluebird Promises.

Usage

On whole objects

const ensureBluebird = require("ensure-bluebird")
// ensure all top-level methods return bluebird Promises (if they are returning any promise)
const fse = ensureBluebird(require("fs-extra"))

Or on individual functions

const ensureBluebird = require("ensure-bluebird")
const copy = ensureBluebird(require("fs-extra").copy)

If the function doesn't return a promise previously, it won't return a promise afterwards. Also static properties are not affected by applying ensureBluebird.