greenlock.js-ARCHIVED/lib/compat.js

24 lines
519 B
JavaScript
Raw Normal View History

'use strict';
function requireBluebird() {
2019-10-08 10:51:15 +00:00
try {
return require('bluebird');
} catch (e) {
console.error('');
console.error(
"DON'T PANIC. You're running an old version of node with incomplete Promise support."
);
console.error('EASY FIX: `npm install --save bluebird`');
console.error('');
throw e;
}
}
if ('undefined' === typeof Promise) {
2019-10-08 10:51:15 +00:00
global.Promise = requireBluebird();
}
if ('function' !== typeof require('util').promisify) {
2019-10-08 10:51:15 +00:00
require('util').promisify = requireBluebird().promisify;
}