question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

May I use global.Promise=require("bluebird") ?

See original GitHub issue
global.Promise=require("bluebird");

Is it suitable to replace the v8’s Promise implementation?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:46
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

12reactions
petkaantonovcommented, Feb 28, 2016

No subclassing

5reactions
vphantomcommented, May 24, 2016

Thanks @phpnode that makes a lot of sense. There are Babel tweaks like https://babeljs.io/docs/plugins/transform-async-to-module-method/ but that’s for the async/await polyfill specifically, no override. According to https://github.com/babel/babel-loader the only way might be:

require('babel-runtime/core-js/promise').default = require('bluebird');

(I don’t use Babel so I haven’t tested this.)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Bluebird Promises - Mastering JS
Even if you set global. Promise = require('bluebird'); , async functions will still return native promises.
Read more >
Can I override ES6's Promise by bluebird's implementation in ...
var Promise = require("bluebird");. , which results in overriding the native Promise element. Because bluebird is a superset of the spec, it ...
Read more >
Features - Bluebird JS
The usual way to use promises in node is to Promise. ... Most libraries can be promisified by requiring the library's classes (constructor...
Read more >
Bluebird's Bad-Practice Docs. The Terrible Best ... - ITNEXT
There are plenty of promise libraries out there, but the one you'll see used in production, is Bluebird. It's a fantastic promise library ......
Read more >
Enterprise-grade Node.js Promises with Async and Bluebird
Bluebird also contains a superset API that overlays the A+/Promise specification. Some of the APIs that do not exist in the native Promise...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found