From 1b388788d8c0060ff023826a5302b7be6661acf9 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sun, 7 Apr 2019 18:27:49 -0600 Subject: [PATCH] v2.7.14: node v6 fix --- index.js | 8 +++++--- package-lock.json | 8 ++++---- package.json | 4 ++-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/index.js b/index.js index c06df9c..f6938d4 100644 --- a/index.js +++ b/index.js @@ -10,12 +10,14 @@ try { } catch(e) { PromiseA = global.Promise; } -var util = require('util'); +if (!PromiseA.promisify) { + PromiseA.promisify = require('util'); +} function promisifyAllSelf(obj) { if (obj.__promisified) { return obj; } Object.keys(obj).forEach(function (key) { if ('function' === typeof obj[key] && !/Async$/.test(key)) { - obj[key + 'Async'] = util.promisify(obj[key]); + obj[key + 'Async'] = PromiseA.promisify(obj[key]); } }); obj.__promisified = true; @@ -30,7 +32,7 @@ function promisifyAllStore(obj) { // wrap just in case it's synchronous (or improperly throws) p = function (opts) { return PromiseA.resolve().then(function () { obj[key](opts); }); }; } else { - p = util.promisify(obj[key]); + p = PromiseA.promisify(obj[key]); } // internal backwards compat obj[key + 'Async'] = p; diff --git a/package-lock.json b/package-lock.json index 8af3e20..3600942 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "greenlock", - "version": "2.7.13", + "version": "2.7.14", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -18,9 +18,9 @@ } }, "acme-v2": { - "version": "1.7.5", - "resolved": "https://registry.npmjs.org/acme-v2/-/acme-v2-1.7.5.tgz", - "integrity": "sha512-jru7mOO/gT/ZfpRJo7m8QDWy2xea7A0xZsR9zlvMfm0+kQsE8DI3DJXOVN/1iMeQOMCHp0sZVqYRqB42XAKAdw==", + "version": "1.7.6", + "resolved": "https://registry.npmjs.org/acme-v2/-/acme-v2-1.7.6.tgz", + "integrity": "sha512-k4ZlTI8txU7AweKny2MK9EAJTSCSu9ueodrv3v91r2NckTuHRu8ELzN3LbP5zlTrb2coNFay4uLcA3u4ona67A==", "requires": { "@coolaj86/urequest": "^1.3.6", "rsa-compat": "^2.0.6" diff --git a/package.json b/package.json index de71a13..3fc66fb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "greenlock", - "version": "2.7.13", + "version": "2.7.14", "description": "Let's Encrypt for node.js on npm", "main": "index.js", "files": [ @@ -39,7 +39,7 @@ }, "dependencies": { "acme": "^1.3.0", - "acme-v2": "^1.7.5", + "acme-v2": "^1.7.6", "cert-info": "^1.5.1", "keypairs": "^1.2.14", "le-challenge-dns": "^3.0.3",