Back to Bluebird

Getting Started

docs/docs/getting-started.md

3.7.21.2 KB
Original Source

getting-started

Node.js

npm install bluebird

Then:

js
var Promise = require("bluebird");

Alternatively in ES6

js
import * as Promise from "bluebird";

If that ES6 import doesn't work

js
import {Promise} from "bluebird";

Browsers

(See also Installation.)

There are many ways to use bluebird in browsers:

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.