From c1515969b48994e5a4fd36e3f0a02a566212d96c Mon Sep 17 00:00:00 2001 From: Zachary Boyd Date: Sun, 9 Sep 2018 00:25:40 -0400 Subject: [PATCH] Adds a sepreate file for a silent winston logger to be used whenever a logger is not specified. Replaces all callbacks with Promises in TorPool. --- CHANGELOG.md | 3 + package-lock.json | 582 ++++++++++++++++------------------- src/TorPool.js | 198 ++++++------ src/TorProcess.js | 2 +- src/winston-silent-logger.js | 6 + test/test.js | 11 +- 6 files changed, 363 insertions(+), 439 deletions(-) create mode 100644 src/winston-silent-logger.js diff --git a/CHANGELOG.md b/CHANGELOG.md index b2faa91..e7d5f18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ ### Changes - All methods now return promises instead of accepting callbacks. Methods now take advantage of async/await resulting in clearer code. Compatibility with node < v8 will be broken. +### Removes +- The `new_ips` and `new_ip_at` TorPool and `new_ip` TorProcess have been removed. Use `new_identites`, `new_identity_at` and `new_identity` instead. + ## [3.4.3] - 2018-08-10 ### Added diff --git a/package-lock.json b/package-lock.json index e371fb1..b7564b9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tor-router", - "version": "3.4.3", + "version": "4.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -20,7 +20,7 @@ "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.0.tgz", "integrity": "sha512-c+R/U5X+2zz2+UCrCFv6odQzJdoqI+YecuhnAJLa1zYaMc13zPfwMwZrr91Pd1DYNo/yPRbiM4WVf9whgwFsIg==", "requires": { - "es6-promisify": "5.0.0" + "es6-promisify": "^5.0.0" } }, "ajv": { @@ -29,10 +29,10 @@ "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", "dev": true, "requires": { - "co": "4.6.0", - "fast-deep-equal": "1.1.0", - "fast-json-stable-stringify": "2.0.0", - "json-schema-traverse": "0.3.1" + "co": "^4.6.0", + "fast-deep-equal": "^1.0.0", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.3.0" } }, "ansi-regex": { @@ -45,7 +45,7 @@ "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", "requires": { - "array-uniq": "1.0.3" + "array-uniq": "^1.0.1" } }, "array-uniq": { @@ -69,7 +69,7 @@ "resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz", "integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==", "requires": { - "lodash": "4.17.10" + "lodash": "^4.14.0" } }, "asynckit": { @@ -102,7 +102,7 @@ "dev": true, "optional": true, "requires": { - "tweetnacl": "0.14.5" + "tweetnacl": "^0.14.3" } }, "boolbase": { @@ -116,7 +116,7 @@ "integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=", "dev": true, "requires": { - "hoek": "4.2.1" + "hoek": "4.x.x" } }, "brace-expansion": { @@ -124,7 +124,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "requires": { - "balanced-match": "1.0.0", + "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, @@ -139,7 +139,7 @@ "resolved": "https://registry.npmjs.org/buffercursor/-/buffercursor-0.0.12.tgz", "integrity": "sha1-eKmn9DQ659ggqJmazIDeWR4lp3k=", "requires": { - "verror": "1.10.0" + "verror": "^1.4.0" } }, "camelcase": { @@ -158,12 +158,12 @@ "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.2.tgz", "integrity": "sha1-S59TqBsn5NXawxwP/Qz6A8xoMNs=", "requires": { - "css-select": "1.2.0", - "dom-serializer": "0.1.0", - "entities": "1.1.1", - "htmlparser2": "3.9.2", - "lodash": "4.17.10", - "parse5": "3.0.3" + "css-select": "~1.2.0", + "dom-serializer": "~0.1.0", + "entities": "~1.1.1", + "htmlparser2": "^3.9.1", + "lodash": "^4.15.0", + "parse5": "^3.0.1" } }, "cli": { @@ -171,7 +171,7 @@ "resolved": "https://registry.npmjs.org/cli/-/cli-0.4.5.tgz", "integrity": "sha1-ePlIXNFhtWbppsctcXDEJw6B22E=", "requires": { - "glob": "7.1.2" + "glob": ">= 3.1.4" } }, "cliff": { @@ -179,9 +179,9 @@ "resolved": "https://registry.npmjs.org/cliff/-/cliff-0.1.10.tgz", "integrity": "sha1-U74z6p9ZvshWCe4wCsQgdgPlIBM=", "requires": { - "colors": "1.0.3", - "eyes": "0.1.8", - "winston": "0.8.3" + "colors": "~1.0.3", + "eyes": "~0.1.8", + "winston": "0.8.x" }, "dependencies": { "async": { @@ -194,13 +194,13 @@ "resolved": "https://registry.npmjs.org/winston/-/winston-0.8.3.tgz", "integrity": "sha1-ZLar9M0Brcrv1QCTk7HY6L7BnbA=", "requires": { - "async": "0.2.10", - "colors": "0.6.2", - "cycle": "1.0.3", - "eyes": "0.1.8", - "isstream": "0.1.2", - "pkginfo": "0.3.1", - "stack-trace": "0.0.10" + "async": "0.2.x", + "colors": "0.6.x", + "cycle": "1.0.x", + "eyes": "0.1.x", + "isstream": "0.1.x", + "pkginfo": "0.3.x", + "stack-trace": "0.0.x" }, "dependencies": { "colors": { @@ -217,9 +217,9 @@ "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", "requires": { - "string-width": "2.1.1", - "strip-ansi": "4.0.0", - "wrap-ansi": "2.1.0" + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" } }, "co": { @@ -238,8 +238,8 @@ "resolved": "https://registry.npmjs.org/color/-/color-0.8.0.tgz", "integrity": "sha1-iQwHw/1OZJU3Y4kRz2keVFi2/KU=", "requires": { - "color-convert": "0.5.3", - "color-string": "0.3.0" + "color-convert": "^0.5.0", + "color-string": "^0.3.0" } }, "color-convert": { @@ -257,7 +257,7 @@ "resolved": "https://registry.npmjs.org/color-string/-/color-string-0.3.0.tgz", "integrity": "sha1-J9RvtnAlxcL6JZk7+/V55HhBuZE=", "requires": { - "color-name": "1.1.3" + "color-name": "^1.0.0" } }, "colornames": { @@ -275,8 +275,8 @@ "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.0.1.tgz", "integrity": "sha1-yZx5btMRKLmHalLh7l7gOkpxl0k=", "requires": { - "color": "0.8.0", - "text-hex": "0.0.0" + "color": "0.8.x", + "text-hex": "0.0.x" } }, "combined-stream": { @@ -285,7 +285,7 @@ "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", "dev": true, "requires": { - "delayed-stream": "1.0.0" + "delayed-stream": "~1.0.0" } }, "commander": { @@ -309,9 +309,9 @@ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", "requires": { - "lru-cache": "4.1.3", - "shebang-command": "1.2.0", - "which": "1.3.0" + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" } }, "cryptiles": { @@ -320,7 +320,7 @@ "integrity": "sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4=", "dev": true, "requires": { - "boom": "5.2.0" + "boom": "5.x.x" }, "dependencies": { "boom": { @@ -329,7 +329,7 @@ "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==", "dev": true, "requires": { - "hoek": "4.2.1" + "hoek": "4.x.x" } } } @@ -339,10 +339,10 @@ "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", "integrity": "sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=", "requires": { - "boolbase": "1.0.0", - "css-what": "2.1.0", + "boolbase": "~1.0.0", + "css-what": "2.1", "domutils": "1.5.1", - "nth-check": "1.0.1" + "nth-check": "~1.0.1" } }, "css-what": { @@ -361,7 +361,7 @@ "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", "dev": true, "requires": { - "assert-plus": "1.0.0" + "assert-plus": "^1.0.0" } }, "debug": { @@ -383,12 +383,12 @@ "resolved": "https://registry.npmjs.org/del/-/del-3.0.0.tgz", "integrity": "sha1-U+z2mf/LyzljdpGrE7rxYIGXZuU=", "requires": { - "globby": "6.1.0", - "is-path-cwd": "1.0.0", - "is-path-in-cwd": "1.0.1", - "p-map": "1.2.0", - "pify": "3.0.0", - "rimraf": "2.2.8" + "globby": "^6.1.0", + "is-path-cwd": "^1.0.0", + "is-path-in-cwd": "^1.0.0", + "p-map": "^1.1.1", + "pify": "^3.0.0", + "rimraf": "^2.2.8" } }, "delayed-stream": { @@ -402,9 +402,9 @@ "resolved": "https://registry.npmjs.org/diagnostics/-/diagnostics-1.1.0.tgz", "integrity": "sha1-4QkJALSVI+hSe+IPCBJ1IF8q42o=", "requires": { - "colorspace": "1.0.1", - "enabled": "1.0.2", - "kuler": "0.0.0" + "colorspace": "1.0.x", + "enabled": "1.0.x", + "kuler": "0.0.x" } }, "diff": { @@ -418,8 +418,8 @@ "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz", "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=", "requires": { - "domelementtype": "1.1.3", - "entities": "1.1.1" + "domelementtype": "~1.1.1", + "entities": "~1.1.1" }, "dependencies": { "domelementtype": { @@ -439,7 +439,7 @@ "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz", "integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==", "requires": { - "domelementtype": "1.3.0" + "domelementtype": "1" } }, "domutils": { @@ -447,8 +447,8 @@ "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", "requires": { - "dom-serializer": "0.1.0", - "domelementtype": "1.3.0" + "dom-serializer": "0", + "domelementtype": "1" } }, "ecc-jsbn": { @@ -458,7 +458,7 @@ "dev": true, "optional": true, "requires": { - "jsbn": "0.1.1" + "jsbn": "~0.1.0" } }, "enabled": { @@ -466,7 +466,7 @@ "resolved": "https://registry.npmjs.org/enabled/-/enabled-1.0.2.tgz", "integrity": "sha1-ll9lE9LC0cX0ZStkouM5ZGf8L5M=", "requires": { - "env-variable": "0.0.4" + "env-variable": "0.0.x" } }, "entities": { @@ -489,7 +489,7 @@ "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", "requires": { - "es6-promise": "4.2.4" + "es6-promise": "^4.0.3" } }, "escape-string-regexp": { @@ -508,13 +508,13 @@ "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", "requires": { - "cross-spawn": "5.1.0", - "get-stream": "3.0.0", - "is-stream": "1.1.0", - "npm-run-path": "2.0.2", - "p-finally": "1.0.0", - "signal-exit": "3.0.2", - "strip-eof": "1.0.0" + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" } }, "extend": { @@ -545,11 +545,6 @@ "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", "dev": true }, - "fast-safe-stringify": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.5.tgz", - "integrity": "sha512-QHbbCj2PmRSMNL9P7EuNBCeNXO06/E3t3XyQgb32AZul8wLmRa1Wbt2cm7GeUsX9OZGyXTQxMYcPOEBqARyhNw==" - }, "fecha": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fecha/-/fecha-2.3.3.tgz", @@ -560,7 +555,7 @@ "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "requires": { - "locate-path": "2.0.0" + "locate-path": "^2.0.0" } }, "follow-redirects": { @@ -568,7 +563,7 @@ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.4.1.tgz", "integrity": "sha512-uxYePVPogtya1ktGnAAXOacnbIuRMB4dkvqeNz2qTtTQsuzSfbDolV+wMMKxAmCx0bLgAKLbBOkjItMbbkR1vg==", "requires": { - "debug": "3.1.0" + "debug": "^3.1.0" }, "dependencies": { "debug": { @@ -593,9 +588,9 @@ "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", "dev": true, "requires": { - "asynckit": "0.4.0", + "asynckit": "^0.4.0", "combined-stream": "1.0.6", - "mime-types": "2.1.18" + "mime-types": "^2.1.12" } }, "fs.realpath": { @@ -613,7 +608,7 @@ "resolved": "https://registry.npmjs.org/get-port/-/get-port-2.1.0.tgz", "integrity": "sha1-h4P53OvR7qSVozThpqJR54iHqxo=", "requires": { - "pinkie-promise": "2.0.1" + "pinkie-promise": "^2.0.0" } }, "get-stream": { @@ -627,7 +622,7 @@ "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", "dev": true, "requires": { - "assert-plus": "1.0.0" + "assert-plus": "^1.0.0" } }, "glob": { @@ -635,12 +630,12 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "globby": { @@ -648,11 +643,11 @@ "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", "requires": { - "array-union": "1.0.2", - "glob": "7.1.2", - "object-assign": "4.1.1", - "pify": "2.3.0", - "pinkie-promise": "2.0.1" + "array-union": "^1.0.1", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" }, "dependencies": { "pify": { @@ -668,11 +663,11 @@ "integrity": "sha512-oo2E7D7IwZORxan9duXjdMhm3fcjzZYWMq7CWPQsYvscoJy/4J6aNA2J94yljXlDz+HhomhC71Ge/QgUNRtsFw==", "requires": { "7zip": "0.0.6", - "async": "2.6.0", - "latest-torbrowser-version": "2.0.1", - "merge": "1.2.0", - "mkdirp": "0.5.1", - "ncp": "2.0.0" + "async": "^2.3.0", + "latest-torbrowser-version": "^2.0.1", + "merge": "^1.2.0", + "mkdirp": "^0.5.1", + "ncp": "^2.0.0" } }, "growl": { @@ -693,8 +688,8 @@ "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", "dev": true, "requires": { - "ajv": "5.5.2", - "har-schema": "2.0.0" + "ajv": "^5.1.0", + "har-schema": "^2.0.0" } }, "has-flag": { @@ -709,10 +704,10 @@ "integrity": "sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ==", "dev": true, "requires": { - "boom": "4.3.1", - "cryptiles": "3.1.2", - "hoek": "4.2.1", - "sntp": "2.1.0" + "boom": "4.x.x", + "cryptiles": "3.x.x", + "hoek": "4.x.x", + "sntp": "2.x.x" } }, "he": { @@ -737,12 +732,12 @@ "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.9.2.tgz", "integrity": "sha1-G9+HrMoPP55T+k/M6w9LTLsAszg=", "requires": { - "domelementtype": "1.3.0", - "domhandler": "2.4.2", - "domutils": "1.5.1", - "entities": "1.1.1", - "inherits": "2.0.3", - "readable-stream": "2.3.6" + "domelementtype": "^1.3.0", + "domhandler": "^2.3.0", + "domutils": "^1.5.1", + "entities": "^1.1.1", + "inherits": "^2.0.1", + "readable-stream": "^2.0.2" } }, "http-signature": { @@ -751,9 +746,9 @@ "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", "dev": true, "requires": { - "assert-plus": "1.0.0", - "jsprim": "1.4.1", - "sshpk": "1.14.1" + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" } }, "inflight": { @@ -761,8 +756,8 @@ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" + "once": "^1.3.0", + "wrappy": "1" } }, "inherits": { @@ -810,7 +805,7 @@ "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz", "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==", "requires": { - "is-path-inside": "1.0.1" + "is-path-inside": "^1.0.0" } }, "is-path-inside": { @@ -818,7 +813,7 @@ "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", "requires": { - "path-is-inside": "1.0.2" + "path-is-inside": "^1.0.1" } }, "is-stream": { @@ -852,8 +847,8 @@ "resolved": "https://registry.npmjs.org/jrpc2/-/jrpc2-1.0.5.tgz", "integrity": "sha1-dyGptrP6+qz8QE0N0RkOI4ZCCN4=", "requires": { - "async": "1.5.2", - "xtend": "4.0.1" + "async": "^1.2", + "xtend": "^4.0.0" }, "dependencies": { "async": { @@ -926,10 +921,10 @@ "resolved": "https://registry.npmjs.org/latest-torbrowser-version/-/latest-torbrowser-version-2.0.1.tgz", "integrity": "sha512-HtbbcKs6cl7Tz4RG+l1uulWd+tOJujn8wqyXd2zZjPRk9rO/mslg7Ajg72beEFCXwHPWZzwVR+w8mPO5yDiOWg==", "requires": { - "async": "2.6.0", - "cheerio": "1.0.0-rc.2", - "follow-redirects": "1.4.1", - "semver": "5.5.0" + "async": "^2.6.0", + "cheerio": "^1.0.0-rc.2", + "follow-redirects": "^1.2.4", + "semver": "^5.4.1" } }, "lcid": { @@ -937,7 +932,7 @@ "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", "requires": { - "invert-kv": "1.0.0" + "invert-kv": "^1.0.0" } }, "locate-path": { @@ -945,8 +940,8 @@ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", "requires": { - "p-locate": "2.0.0", - "path-exists": "3.0.0" + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" } }, "lodash": { @@ -959,10 +954,10 @@ "resolved": "https://registry.npmjs.org/logform/-/logform-1.6.0.tgz", "integrity": "sha512-mW+96uQYDbZDInnO/iby9v3MG19Ei5LYuRGc/iCF2L8KmYveGhvVWQewHOsG/eBBukTUVRv83P4mQQEbqvKC4Q==", "requires": { - "colors": "1.2.4", - "fecha": "2.3.3", - "ms": "2.1.1", - "triple-beam": "1.2.0" + "colors": "^1.2.1", + "fecha": "^2.3.3", + "ms": "^2.1.1", + "triple-beam": "^1.2.0" }, "dependencies": { "colors": { @@ -982,8 +977,8 @@ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", "requires": { - "pseudomap": "1.0.2", - "yallist": "2.1.2" + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" } }, "mem": { @@ -991,7 +986,7 @@ "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", "requires": { - "mimic-fn": "1.2.0" + "mimic-fn": "^1.0.0" } }, "merge": { @@ -1011,7 +1006,7 @@ "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", "dev": true, "requires": { - "mime-db": "1.33.0" + "mime-db": "~1.33.0" } }, "mimic-fn": { @@ -1024,7 +1019,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "requires": { - "brace-expansion": "1.1.11" + "brace-expansion": "^1.1.7" } }, "minimist": { @@ -1071,17 +1066,19 @@ }, "native-dns": { "version": "git+https://github.com/znetstar/node-dns.git#336f1d3027b2a3da719b5cd65380219267901aeb", + "from": "git+https://github.com/znetstar/node-dns.git", "requires": { - "ipaddr.js": "0.1.9", + "ipaddr.js": "~0.1.3", "native-dns-cache": "git+https://github.com/znetstar/native-dns-cache.git#7743c19bd1b70d0ec32a364aadc77fbcfd5a67ad", - "native-dns-packet": "0.1.1" + "native-dns-packet": "~0.1.1" } }, "native-dns-cache": { "version": "git+https://github.com/znetstar/native-dns-cache.git#7743c19bd1b70d0ec32a364aadc77fbcfd5a67ad", + "from": "git+https://github.com/znetstar/native-dns-cache.git", "requires": { - "heap": "0.2.6", - "native-dns-packet": "0.1.1" + "heap": "^0.2.6", + "native-dns-packet": ">= 0.0.1" } }, "native-dns-packet": { @@ -1089,8 +1086,8 @@ "resolved": "https://registry.npmjs.org/native-dns-packet/-/native-dns-packet-0.1.1.tgz", "integrity": "sha1-l9qQVwuEOKABlHAc4k0BH9PMEJo=", "requires": { - "buffercursor": "0.0.12", - "ipaddr.js": "0.1.9" + "buffercursor": ">= 0.0.12", + "ipaddr.js": ">= 0.1.1" } }, "nconf": { @@ -1098,10 +1095,10 @@ "resolved": "https://registry.npmjs.org/nconf/-/nconf-0.10.0.tgz", "integrity": "sha512-fKiXMQrpP7CYWJQzKkPPx9hPgmq+YLDyxcG9N8RpiE9FoCkCbzD0NyW0YhE3xn3Aupe7nnDeIx4PFzYehpHT9Q==", "requires": { - "async": "1.5.2", - "ini": "1.3.5", - "secure-keys": "1.0.0", - "yargs": "3.32.0" + "async": "^1.4.0", + "ini": "^1.3.0", + "secure-keys": "^1.0.0", + "yargs": "^3.19.0" }, "dependencies": { "ansi-regex": { @@ -1124,9 +1121,9 @@ "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", "requires": { - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wrap-ansi": "2.1.0" + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" } }, "is-fullwidth-code-point": { @@ -1134,7 +1131,7 @@ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "requires": { - "number-is-nan": "1.0.1" + "number-is-nan": "^1.0.0" } }, "os-locale": { @@ -1142,7 +1139,7 @@ "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", "requires": { - "lcid": "1.0.0" + "lcid": "^1.0.0" } }, "string-width": { @@ -1150,9 +1147,9 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" } }, "strip-ansi": { @@ -1160,7 +1157,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } }, "yargs": { @@ -1168,13 +1165,13 @@ "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz", "integrity": "sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU=", "requires": { - "camelcase": "2.1.1", - "cliui": "3.2.0", - "decamelize": "1.2.0", - "os-locale": "1.4.0", - "string-width": "1.0.2", - "window-size": "0.1.4", - "y18n": "3.2.1" + "camelcase": "^2.0.1", + "cliui": "^3.0.3", + "decamelize": "^1.1.1", + "os-locale": "^1.4.0", + "string-width": "^1.0.1", + "window-size": "^0.1.4", + "y18n": "^3.2.0" } } } @@ -1190,7 +1187,7 @@ "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", "requires": { - "path-key": "2.0.1" + "path-key": "^2.0.0" } }, "nth-check": { @@ -1198,7 +1195,7 @@ "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.1.tgz", "integrity": "sha1-mSms32KPwsQQmN6rgqxYDPFJquQ=", "requires": { - "boolbase": "1.0.0" + "boolbase": "~1.0.0" } }, "number-is-nan": { @@ -1222,7 +1219,7 @@ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "requires": { - "wrappy": "1.0.2" + "wrappy": "1" } }, "one-time": { @@ -1235,9 +1232,9 @@ "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", "requires": { - "execa": "0.7.0", - "lcid": "1.0.0", - "mem": "1.1.0" + "execa": "^0.7.0", + "lcid": "^1.0.0", + "mem": "^1.1.0" } }, "os-tmpdir": { @@ -1255,7 +1252,7 @@ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.2.0.tgz", "integrity": "sha512-Y/OtIaXtUPr4/YpMv1pCL5L5ed0rumAaAeBSj12F+bSlMdys7i8oQF/GUJmfpTS/QoaRrS/k6pma29haJpsMng==", "requires": { - "p-try": "1.0.0" + "p-try": "^1.0.0" } }, "p-locate": { @@ -1263,7 +1260,7 @@ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", "requires": { - "p-limit": "1.2.0" + "p-limit": "^1.1.0" } }, "p-map": { @@ -1281,7 +1278,7 @@ "resolved": "https://registry.npmjs.org/parse5/-/parse5-3.0.3.tgz", "integrity": "sha512-rgO9Zg5LLLkfJF9E6CCmXlSE4UVceloys8JrFqCcHloC3usd/kJCyPDwH2SOlzix2j3xaP9sUX3e8+kvkuleAA==", "requires": { - "@types/node": "10.0.6" + "@types/node": "*" } }, "path-exists": { @@ -1330,7 +1327,7 @@ "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", "requires": { - "pinkie": "2.0.4" + "pinkie": "^2.0.0" } }, "pkginfo": { @@ -1365,13 +1362,13 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.2", - "string_decoder": "1.1.1", - "util-deprecate": "1.0.2" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" } }, "rechoir": { @@ -1379,7 +1376,7 @@ "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", "requires": { - "resolve": "1.7.1" + "resolve": "^1.1.6" } }, "request": { @@ -1388,28 +1385,28 @@ "integrity": "sha512-8H7Ehijd4js+s6wuVPLjwORxD4zeuyjYugprdOXlPSqaApmL/QOy+EB/beICHVCHkGMKNh5rvihb5ov+IDw4mg==", "dev": true, "requires": { - "aws-sign2": "0.7.0", - "aws4": "1.7.0", - "caseless": "0.12.0", - "combined-stream": "1.0.6", - "extend": "3.0.1", - "forever-agent": "0.6.1", - "form-data": "2.3.2", - "har-validator": "5.0.3", - "hawk": "6.0.2", - "http-signature": "1.2.0", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.18", - "oauth-sign": "0.8.2", - "performance-now": "2.1.0", - "qs": "6.5.2", - "safe-buffer": "5.1.2", - "stringstream": "0.0.6", - "tough-cookie": "2.3.4", - "tunnel-agent": "0.6.0", - "uuid": "3.2.1" + "aws-sign2": "~0.7.0", + "aws4": "^1.6.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.5", + "extend": "~3.0.1", + "forever-agent": "~0.6.1", + "form-data": "~2.3.1", + "har-validator": "~5.0.3", + "hawk": "~6.0.2", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.17", + "oauth-sign": "~0.8.2", + "performance-now": "^2.1.0", + "qs": "~6.5.1", + "safe-buffer": "^5.1.1", + "stringstream": "~0.0.5", + "tough-cookie": "~2.3.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.1.0" } }, "require-directory": { @@ -1427,7 +1424,7 @@ "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.7.1.tgz", "integrity": "sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw==", "requires": { - "path-parse": "1.0.5" + "path-parse": "^1.0.5" } }, "rimraf": { @@ -1460,7 +1457,7 @@ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", "requires": { - "shebang-regex": "1.0.0" + "shebang-regex": "^1.0.0" } }, "shebang-regex": { @@ -1473,9 +1470,9 @@ "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.2.tgz", "integrity": "sha512-pRXeNrCA2Wd9itwhvLp5LZQvPJ0wU6bcjaTMywHHGX5XWhVN2nzSu7WV0q+oUY7mGK3mgSkDDzP3MgjqdyIgbQ==", "requires": { - "glob": "7.1.2", - "interpret": "1.1.0", - "rechoir": "0.6.2" + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" } }, "signal-exit": { @@ -1494,7 +1491,7 @@ "integrity": "sha512-FL1b58BDrqS3A11lJ0zEdnJ3UOKqVxawAkF3k7F0CVN7VQ34aZrV+G8BZ1WC9ZL7NyrwsW0oviwsWDgRuVYtJg==", "dev": true, "requires": { - "hoek": "4.2.1" + "hoek": "4.x.x" } }, "socks": { @@ -1502,8 +1499,8 @@ "resolved": "https://registry.npmjs.org/socks/-/socks-1.1.10.tgz", "integrity": "sha1-W4t/x8jzQcU+0FbpKbe/Tei6e1o=", "requires": { - "ip": "1.1.5", - "smart-buffer": "1.1.15" + "ip": "^1.1.4", + "smart-buffer": "^1.0.13" } }, "socks-proxy-agent": { @@ -1511,23 +1508,24 @@ "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-3.0.1.tgz", "integrity": "sha512-ZwEDymm204mTzvdqyUqOdovVr2YRd2NYskrYrF2LXyZ9qDiMAoFESGK8CRphiO7rtbo2Y757k2Nia3x2hGtalA==", "requires": { - "agent-base": "4.2.0", - "socks": "1.1.10" + "agent-base": "^4.1.0", + "socks": "^1.1.10" } }, "socksv5": { "version": "git+https://github.com/lee-elenbaas/socksv5.git#7039cb6aeb39fa3187b327bb2de5d1aedaae6a56", + "from": "git+https://github.com/lee-elenbaas/socksv5.git", "requires": { - "ipv6": "3.1.1" + "ipv6": "*" }, "dependencies": { "ipv6": { "version": "3.1.1", "bundled": true, "requires": { - "cli": "0.4.5", - "cliff": "0.1.10", - "sprintf": "0.1.3" + "cli": "0.4.x", + "cliff": "0.1.x", + "sprintf": "0.1.x" }, "dependencies": { "sprintf": { @@ -1544,14 +1542,14 @@ "integrity": "sha1-Ew9Zde3a2WPx1W+SuaxsUfqfg+s=", "dev": true, "requires": { - "asn1": "0.2.3", - "assert-plus": "1.0.0", - "bcrypt-pbkdf": "1.0.1", - "dashdash": "1.14.1", - "ecc-jsbn": "0.1.1", - "getpass": "0.1.7", - "jsbn": "0.1.1", - "tweetnacl": "0.14.5" + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "tweetnacl": "~0.14.0" } }, "stack-trace": { @@ -1564,8 +1562,8 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "4.0.0" + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" } }, "string_decoder": { @@ -1573,7 +1571,7 @@ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "requires": { - "safe-buffer": "5.1.2" + "safe-buffer": "~5.1.0" } }, "stringstream": { @@ -1587,7 +1585,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "requires": { - "ansi-regex": "3.0.0" + "ansi-regex": "^3.0.0" } }, "strip-eof": { @@ -1601,7 +1599,7 @@ "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "3.0.0" + "has-flag": "^3.0.0" } }, "temp": { @@ -1609,8 +1607,8 @@ "resolved": "https://registry.npmjs.org/temp/-/temp-0.8.3.tgz", "integrity": "sha1-4Ma8TSa5AxJEEOT+2BEDAU38H1k=", "requires": { - "os-tmpdir": "1.0.2", - "rimraf": "2.2.8" + "os-tmpdir": "^1.0.0", + "rimraf": "~2.2.6" } }, "text-hex": { @@ -1624,7 +1622,7 @@ "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", "dev": true, "requires": { - "punycode": "1.4.1" + "punycode": "^1.4.1" } }, "triple-beam": { @@ -1638,7 +1636,7 @@ "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", "dev": true, "requires": { - "safe-buffer": "5.1.2" + "safe-buffer": "^5.0.1" } }, "tweetnacl": { @@ -1664,9 +1662,9 @@ "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", "requires": { - "assert-plus": "1.0.0", + "assert-plus": "^1.0.0", "core-util-is": "1.0.2", - "extsprintf": "1.4.0" + "extsprintf": "^1.2.0" } }, "which": { @@ -1674,7 +1672,7 @@ "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", "requires": { - "isexe": "2.0.0" + "isexe": "^2.0.0" } }, "which-module": { @@ -1692,74 +1690,14 @@ "resolved": "https://registry.npmjs.org/winston/-/winston-3.0.0-rc5.tgz", "integrity": "sha512-BRYS7jsNkfLAqGu4dZW3kp6CmqiWKrComvfsIMYdsnpPre7g8BIw63nWRyX69vxyLYvZdszcEyxJkJmILXd/pA==", "requires": { - "async": "2.6.0", - "diagnostics": "1.1.0", - "is-stream": "1.1.0", - "logform": "1.6.0", + "async": "^2.6.0", + "diagnostics": "^1.0.1", + "is-stream": "^1.1.0", + "logform": "^1.4.1", "one-time": "0.0.4", - "stack-trace": "0.0.10", - "triple-beam": "1.2.0", - "winston-transport": "3.2.1" - } - }, - "winston-null-transport": { - "version": "git+https://github.com/NCIOCPL/winston-null-transport.git#25fd9db62140814b9aed506374edeb374fbd60e0", - "requires": { - "winston": "3.0.0" - }, - "dependencies": { - "colors": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.3.1.tgz", - "integrity": "sha512-jg/vxRmv430jixZrC+La5kMbUWqIg32/JsYNZb94+JEmzceYbWKTsv1OuTp+7EaqiaWRR2tPcykibwCRgclIsw==" - }, - "logform": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/logform/-/logform-1.9.1.tgz", - "integrity": "sha512-ZHrZE8VSf7K3xKxJiQ1aoTBp2yK+cEbFcgarsjzI3nt3nE/3O0heNSppoOQMUJVMZo/xiVwCxiXIabaZApsKNQ==", - "requires": { - "colors": "1.3.1", - "fast-safe-stringify": "2.0.5", - "fecha": "2.3.3", - "ms": "2.1.1", - "triple-beam": "1.3.0" - } - }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" - }, - "triple-beam": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz", - "integrity": "sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==" - }, - "winston": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/winston/-/winston-3.0.0.tgz", - "integrity": "sha512-7QyfOo1PM5zGL6qma6NIeQQMh71FBg/8fhkSAePqtf5YEi6t+UrPDcUuHhuuUasgso49ccvMEsmqr0GBG2qaMQ==", - "requires": { - "async": "2.6.0", - "diagnostics": "1.1.0", - "is-stream": "1.1.0", - "logform": "1.9.1", - "one-time": "0.0.4", - "readable-stream": "2.3.6", - "stack-trace": "0.0.10", - "triple-beam": "1.3.0", - "winston-transport": "4.2.0" - } - }, - "winston-transport": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.2.0.tgz", - "integrity": "sha512-0R1bvFqxSlK/ZKTH86nymOuKv/cT1PQBMuDdA7k7f0S9fM44dNH6bXnuxwXPrN8lefJgtZq08BKdyZ0DZIy/rg==", - "requires": { - "readable-stream": "2.3.6", - "triple-beam": "1.3.0" - } - } + "stack-trace": "0.0.x", + "triple-beam": "^1.0.1", + "winston-transport": "^3.1.0" } }, "winston-transport": { @@ -1772,8 +1710,8 @@ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", "requires": { - "string-width": "1.0.2", - "strip-ansi": "3.0.1" + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" }, "dependencies": { "ansi-regex": { @@ -1786,7 +1724,7 @@ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "requires": { - "number-is-nan": "1.0.1" + "number-is-nan": "^1.0.0" } }, "string-width": { @@ -1794,9 +1732,9 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" } }, "strip-ansi": { @@ -1804,7 +1742,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } } } @@ -1834,18 +1772,18 @@ "resolved": "https://registry.npmjs.org/yargs/-/yargs-11.0.0.tgz", "integrity": "sha512-Rjp+lMYQOWtgqojx1dEWorjCofi1YN7AoFvYV7b1gx/7dAAeuI4kN5SZiEvr0ZmsZTOpDRcCqrpI10L31tFkBw==", "requires": { - "cliui": "4.1.0", - "decamelize": "1.2.0", - "find-up": "2.1.0", - "get-caller-file": "1.0.2", - "os-locale": "2.1.0", - "require-directory": "2.1.1", - "require-main-filename": "1.0.1", - "set-blocking": "2.0.0", - "string-width": "2.1.1", - "which-module": "2.0.0", - "y18n": "3.2.1", - "yargs-parser": "9.0.2" + "cliui": "^4.0.0", + "decamelize": "^1.1.1", + "find-up": "^2.1.0", + "get-caller-file": "^1.0.1", + "os-locale": "^2.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^9.0.2" } }, "yargs-parser": { @@ -1853,7 +1791,7 @@ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-9.0.2.tgz", "integrity": "sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=", "requires": { - "camelcase": "4.1.0" + "camelcase": "^4.1.0" } } } diff --git a/src/TorPool.js b/src/TorPool.js index ac37c70..c3a4268 100644 --- a/src/TorPool.js +++ b/src/TorPool.js @@ -26,24 +26,6 @@ const nanoid = require('nanoid'); const fs = require('fs'); const WeightedList = require('js-weighted-list'); -const load_balance_methods = { - round_robin: function (instances) { - return instances.rotate(1); - }, - weighted: function (instances) { - if (!instances._weighted_list) { - instances._weighted_list = new WeightedList( - instances.map((instance) => { - return [ instance.id, instance.definition.Weight, instance ] - }) - ); - }; - let i = instances._weighted_list.peek(instances.length).map((element) => element.data); - i._weighted_list = instances._weighted_list; - return i; - } -}; - class TorPool extends EventEmitter { constructor(tor_path, default_config, data_directory, load_balance_method, granax_options, logger) { super(); @@ -54,42 +36,65 @@ class TorPool extends EventEmitter { this.load_balance_method = load_balance_method; !fs.existsSync(this.data_directory) && fs.mkdirSync(this.data_directory); this.tor_path = tor_path; - this.logger = logger; + this.logger = logger || require('./winston-silent-logger'); this.granax_options = granax_options; } + static get load_balance_methods() { + return { + round_robin: function (instances) { + return instances.rotate(1); + }, + weighted: function (instances) { + if (!instances._weighted_list) { + instances._weighted_list = new WeightedList( + instances.map((instance) => { + return [ instance.id, instance.definition.Weight, instance ] + }) + ); + }; + let i = instances._weighted_list.peek(instances.length).map((element) => element.data); + i._weighted_list = instances._weighted_list; + return i; + } + }; + } + get instances() { return this._instances.slice(0).filter((tor) => tor.ready); } - create_instance(instance_definition, callback) { + async create_instance(instance_definition) { this._instances._weighted_list = void(0); if (!instance_definition.Config) instance_definition.Config = _.extend({}, this.default_tor_config); let instance_id = nanoid(); instance_definition.Config.DataDirectory = instance_definition.Config.DataDirectory || path.join(this.data_directory, (instance_definition.Name || instance_id)); + let instance = new TorProcess(this.tor_path, instance_definition.Config, this.granax_options, this.logger); + instance.id = instance_id; instance.definition = instance_definition; - instance.create((error) => { - if (error) return callback(error); - this._instances.push(instance); + + await instance.create(); + + this._instances.push(instance); + + return new Promise((resolve, reject) => { + instance.once('error', reject); - instance.once('error', callback) instance.once('ready', () => { this.emit('instance_created', instance); - callback && callback(null, instance); + resolve(instance); }); }); } - add(instance_definitions, callback) { - async.each(instance_definitions, (instance_definition, next) => { - this.create_instance(instance_definition, next); - }, (callback || (() => {}))); + async add(instance_definitions) { + return await Promise.all(instance_definitions.map((instance_definition) => this.create_instance(instance_definition))); } - create(instances, callback) { + async create(instances) { if (typeof(instances) === 'number') { instances = Array.from(Array(instances)).map(() => { return { @@ -97,7 +102,7 @@ class TorPool extends EventEmitter { }; }); } - return this.add(instances, callback); + return await this.add(instances); } instance_by_name(name) { @@ -108,28 +113,25 @@ class TorPool extends EventEmitter { return this.instances[index]; } - remove(instances, callback) { + async remove(instances) { this._instances._weighted_list = void(0); let instances_to_remove = this._instances.splice(0, instances); - async.each(instances_to_remove, (instance, next) => { - instance.exit(next); - }, callback); + await Promise.all(instances_to_remove.map((instance) => instance.exit())); } - remove_at(instance_index, callback) { + async remove_at(instance_index) { this._instances._weighted_list = void(0); let instance = this._instances.splice(instance_index, 1)[0]; - instance.exit((error) => { - callback(error); - }); + await instance.exit(); } - remove_by_name(instance_name, callback) { + async remove_by_name(instance_name) { let instance = this.instance_by_name(instance_name); - if (!instance) return callback && callback(new Error(`Instance "${name}" not found`)); + if (!instance) + throw new Error(`Instance "${name}" not found`); let instance_index = (this.instances.indexOf(instance)); - return this.remove_at(instance_index, callback); + await this.remove_at(instance_index); } next() { @@ -137,103 +139,83 @@ class TorPool extends EventEmitter { return this.instances[0]; } - exit(callback) { - async.until(() => { return this._instances.length === 0; }, (next) => { - var instance = this._instances.shift(); - instance.exit(next); - }, (error) => { - callback && callback(error); - }); + async exit() { + await Promise.all(this._instances.map((instance) => instance.exit())); + this._instances = []; } - new_identites(callback) { - async.each(this.instances, (tor, next) => { - tor.new_identity(next); - }, (error) => { - callback && callback(error); - }); + async new_identites() { + await Promise.all(this.instances.map((instance) => instance.new_identity(next))); } - new_identity_at(index, callback) { - this.instances[index].new_identity(callback); + async new_identity_at(index) { + await this.instances[index].new_identity(); } - new_identity_by_name(name, callback) { + async new_identity_by_name(name) { let instance = this.instance_by_name(name); - if (!instance) return callback && callback(new Error(`Instance "${name}" not found`)); - instance.new_identity(callback); + + if (!instance) + throw new Error(`Instance "${name}" not found`); + + await instance.new_identity(); } - /* Begin Deprecated */ - new_ips(callback) { - this.logger.warn(`TorPool.new_ips is deprecated, use TorPool.new_identites`); - return this.new_identites(callback); - } - - new_ip_at(index, callback) { - this.logger.warn(`TorPool.new_ip_at is deprecated, use TorPool.new_identity_at`); - return this.new_identity_at(index, callback); - } - - /* End Deprecated */ - - get_config_by_name(name, keyword, callback) { + async get_config_by_name(name, keyword) { let instance = this.instance_by_name(name); - if (!instance) return callback && callback(new Error(`Instance "${name}" not found`)); - instance.get_config(keyword, callback); + if (!instance) + throw new Error(`Instance "${name}" not found`); + + return await instance.get_config(keyword); } - set_config_by_name(name, keyword, value, callback) { + async set_config_by_name(name, keyword, value) { let instance = this.instance_by_name(name); - if (!instance) return callback && callback(new Error(`Instance "${name}" not found`)); - instance.set_config(keyword, value, callback); + if (!instance) + throw new Error(`Instance "${name}" not found`); + + return await instance.set_config(keyword, value); } - get_config_at(index, keyword, callback) { + async get_config_at(index, keyword) { let instance = this.instances[index]; - if (!instance) return callback && callback(new Error(`Instance at ${index} not found`)); - instance.get_config(keyword, callback); + if (!instance) + throw new Error(`Instance at ${index} not found`); + + return await instance.get_config(keyword); } - set_config_at(index, keyword, value, callback) { + async set_config_at(index, keyword, value) { let instance = this.instances[index]; - if (!instance) return callback && callback(new Error(`Instance at ${index} not found`)); - instance.set_config(keyword, value, callback); + if (!instance) + throw new Error(`Instance at ${index} not found`); + return await instance.set_config(keyword, value); } - set_config_all(keyword, value, callback) { - var i = 0; - async.until(() => { return i === this.instances.length; }, (next) => { - let instance = this.instances[i++]; - - instance.set_config(keyword, value, (error) => { - next(error); - }); - }, (error) => { - callback(error); - }); + async set_config_all(keyword, value) { + return await Promise.all(this.instances.map((instance) => instance.set_config(keyword, value))); } - signal_all(signal, callback) { - async.each(this.instances, (instance, next) => { - instance.signal(signal, next); - }, callback); + async signal_all(signal) { + await Promise.all(this.instances.map((instance) => instance.signal(signal, next))); } - signal_by_name(name, signal, callback) { + async signal_by_name(name, signal) { let instance = this.instance_by_name(name); - if (!instance) return callback && callback(new Error(`Instance "${name}" not found`)); - instance.signal(signal, callback); + if (!instance) + throw new Error(`Instance "${name}" not found`); + + await instance.signal(signal); } - signal_at(index, signal, callback) { + async signal_at(index, signal) { let instance = this.instances[index]; - if (!instance) return callback && callback(new Error(`Instance at ${index} not found`)); - instance.signal(signal, callback); + if (!instance) + throw new Error(`Instance at ${index} not found`); + + await instance.signal(signal); } }; -TorPool.LoadBalanceMethods = load_balance_methods; - module.exports = TorPool; \ No newline at end of file diff --git a/src/TorProcess.js b/src/TorProcess.js index 2200018..5c9c3ef 100644 --- a/src/TorProcess.js +++ b/src/TorProcess.js @@ -16,7 +16,7 @@ temp.track(); class TorProcess extends EventEmitter { constructor(tor_path, config, granax_options, logger) { super(); - this.logger = logger; + this.logger = logger || require('./winston-silent-logger'); this.tor_path = tor_path; this.granax_options = granax_options; this.control_password = crypto.randomBytes(128).toString('base64'); diff --git a/src/winston-silent-logger.js b/src/winston-silent-logger.js new file mode 100644 index 0000000..215d982 --- /dev/null +++ b/src/winston-silent-logger.js @@ -0,0 +1,6 @@ +module.exports = require('winston').createLogger({ + level: 'info', + format: winston.format.simple(), + silent: true, + transports: [ new (winston.transports.Console)({ silent: true }) ] +}); \ No newline at end of file diff --git a/test/test.js b/test/test.js index aee53b9..09e3c33 100644 --- a/test/test.js +++ b/test/test.js @@ -11,17 +11,12 @@ const del = require('del'); const rpc = require('jrpc2'); const fs = require('fs'); -var colors = require('mocha/lib/reporters/base').colors; -var nconf = require('nconf'); +const colors = require('mocha/lib/reporters/base').colors; +const nconf = require('nconf'); nconf = require(`${__dirname}/../src/nconf_load_env.js`)(nconf); nconf.defaults(require(`${__dirname}/../src/default_config.js`)); -var logger = winston.createLogger({ - level: 'info', - format: winston.format.simple(), - silent: true, - transports: [ new (winston.transports.Console)({ silent: true }) ] -}); +const logger = require('../src/winston-silent-logger'); const WAIT_FOR_CREATE = 120000; const PAGE_LOAD_TIME = 60000;