npm.io
1.0.1 • Published 9 years ago

bluebird-ployfill

Licence
MIT
Version
1.0.1
Deps
2
Vulns
0
Weekly
0

bluebird-ployfill

npm-v-badge npm-dt-badge travis-ci-master-badge coverge-master-badge

Using bluebird to replace origin Promise in global.

Because origin Promise is so weak, bluebird have good performance, please refer [bluebird-benchmark]

NOTE: This lib is only for Node.js environment

Install

$ node install bluebird-ployfill

Usage & Example

Demo:

Promise has all methods of bluebird.

bluebird-ployfill demo

Code:

import 'bluebird-ployfill';

import { stat } from 'fs';
const statAsync = Promise.promisify(stat);  // Using bluebird promise in global
statAsync('path')
    .then(stats => {
        // do something
    }).catch(err => {
        // do something
    })