From 36ab30c9f2353f717a010066a53b3ddb7845bf88 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sat, 7 Jul 2018 09:47:00 +0000 Subject: [PATCH] remove bluebird --- lib/relay.js | 7 ++++++- package.json | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/relay.js b/lib/relay.js index 78c159b..9b66d26 100644 --- a/lib/relay.js +++ b/lib/relay.js @@ -1,10 +1,15 @@ 'use strict'; var url = require('url'); -var PromiseA = require('bluebird'); var sni = require('sni'); var Packer = require('proxy-packer'); var PortServers = {}; +var PromiseA; +try { + PromiseA = require('bluebird'); +} catch(e) { + PromiseA = global.Promise; +} function timeoutPromise(duration) { return new PromiseA(function (resolve) { diff --git a/package.json b/package.json index 2b89e05..e3ec8b0 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,6 @@ }, "homepage": "https://git.coolaj86.com/coolaj86/telebit-relay.js", "dependencies": { - "bluebird": "^3.5.1", "cluster-store": "^2.0.8", "finalhandler": "^1.1.1", "greenlock": "^2.2.4", @@ -51,6 +50,9 @@ "sni": "^1.0.0", "ws": "^5.1.1" }, + "trulyOptionalDependencies": { + "bluebird": "^3.5.1" + }, "engineStrict": true, "engines": { "node": "10.2.1"