This article is partially or completely unfinished.
You are welcome to create
pull requests
to help completing this article.
Node.js
Then:
var
Promise
=
require
(
"bluebird"
);
Alternatively in ES6
import
*
as
Promise
from
"bluebird"
;
If that ES6 import
doesn't work
import
{
Promise
}
from
"bluebird"
;
Browsers
(See also
Installation
.)
There are many ways to use bluebird in browsers:
- Direct downloads
- You may use browserify on the main export
- You may use the
bower
package.
When using script tags the global variables
Promise
and
P
(alias for
Promise
) become available. Bluebird runs on a wide variety of browsers including older versions. We'd like to thank BrowserStack for giving us a free account which helps us test that.