don't require bluebird
This commit is contained in:
parent
2bd05345d2
commit
d031ad10a1
9
lex.js
9
lex.js
|
@ -10,7 +10,14 @@ module.exports.create = function (opts) {
|
|||
};
|
||||
|
||||
opts.listen = function (plainPort, port) {
|
||||
var PromiseA = require('bluebird');
|
||||
var PromiseA;
|
||||
try {
|
||||
PromiseA = require('bluebird');
|
||||
} catch(e) {
|
||||
console.warn("Package 'bluebird' not installed. Using global.Promise instead");
|
||||
console.warn("(want bluebird instead? npm install --save bluebird)");
|
||||
PromiseA = global.Promise;
|
||||
}
|
||||
var promises = [];
|
||||
var plainPorts = plainPort;
|
||||
var ports = port;
|
||||
|
|
Loading…
Reference in New Issue