native-or-bluebird

use either the native Promise or Bluebird

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
native-or-bluebird
1.2.09 years ago10 years agoMinified + gzip package size for native-or-bluebird in KB

Readme

native-or-bluebird
!NPM versionnpm-imagenpm-url !Build statustravis-imagetravis-url !Test coveragecoveralls-imagecoveralls-url !Dependency Statusdavid-imagedavid-url !Licenselicense-imagelicense-url !Downloadsdownloads-imagedownloads-url !Gittipgittip-imagegittip-url
Use either bluebird or the native Promise implementation. If no implementation is found, an error will be thrown:
var Promise = require('native-or-bluebird');

The goal of this library is to be able to eventually remove this line from your code and use native Promises, allowing you to to write future-compatible code with ease. You should install bluebird in your libraries for maximum compatibility.
If you do not want an error to be thrown, require() the Promise implementation directly. If no implementation is found, undefined will be returned.
var Promise = require('native-or-bluebird/promise');
if (Promise) // do stuff with promises