From a931d2dca7f9ea817663864beb7a09896da5d1c4 Mon Sep 17 00:00:00 2001 From: Chris Campbell Date: Tue, 31 May 2016 16:57:26 -0700 Subject: [PATCH 1/3] Bump suggested node version, add `bin` and `license` keys to package --- .nvmrc | 2 +- index.js | 1 - package.json | 9 +++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.nvmrc b/.nvmrc index cbe06cd..6abaeb2 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -4.4.4 +6.2.0 diff --git a/index.js b/index.js index 9067522..95a4334 100644 --- a/index.js +++ b/index.js @@ -96,7 +96,6 @@ function RedisKeyScanner(options) { throw new TypeError('Unsupported option(s): ' + unsupportedOptions); } this.options = options; - //console.log(options); // Connect to redis server / sentinel var server = _.pick(options, ['host', 'port']), diff --git a/package.json b/package.json index ac3d781..8e243e1 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,20 @@ { "name": "redis-key-scanner", - "version": "0.1.0", + "version": "0.1.1", "description": "Scan redis servers looking for key patterns and activity characteristics", "author": "Change Engineering", + "license": "MIT", + "repository": { "type": "git", "url": "git@github.com:change/redis-key-scanner.git" }, "main": "index", + "bin": "./index", "engines": { - "node": "4.4.4" + "node": ">=4.4.4" }, + "dependencies": { "bluebird": "^3.3.5", "ioredis": "^1.15.1", @@ -22,6 +26,7 @@ "chai": "^3.5.0", "mocha": "^2.4.5" }, + "scripts": { "test": "mocha test.js" } From 3588a9700f7a592421f0f714f5489cd77affa40d Mon Sep 17 00:00:00 2001 From: Chris Campbell Date: Tue, 31 May 2016 17:54:08 -0700 Subject: [PATCH 2/3] Use Node 4.4.5; 6.x has a bug that truncates the usage output --- .nvmrc | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.nvmrc b/.nvmrc index 6abaeb2..fa1ba04 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -6.2.0 +4.4.5 diff --git a/package.json b/package.json index 8e243e1..3fe9f76 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "main": "index", "bin": "./index", "engines": { - "node": ">=4.4.4" + "node": "~4.4.5" }, "dependencies": { From 5a53c4facf22c64aa3f15ea1b27a8d9bb8af714e Mon Sep 17 00:00:00 2001 From: Chris Campbell Date: Wed, 1 Jun 2016 10:56:15 -0700 Subject: [PATCH 3/3] Use Node 6.x workaround suggested by Erik --- .nvmrc | 2 +- index.js | 9 ++++++++- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.nvmrc b/.nvmrc index fa1ba04..6abaeb2 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -4.4.5 +6.2.0 diff --git a/index.js b/index.js index 95a4334..43b7534 100644 --- a/index.js +++ b/index.js @@ -63,6 +63,13 @@ var timeframeToSeconds = require('timeframe-to-seconds'), util = require('util'); +// Fix for stdout truncation bug in Node 6.x +// (https://github.com/nodejs/node/issues/6456) +[process.stdout, process.stderr].forEach((s) => { + s && s.isTTY && s._handle && s._handle.setBlocking && + s._handle.setBlocking(true); +}); + function RedisKeyScanner(options) { var self = this; @@ -230,7 +237,7 @@ function parseCommandLineAndScanKeys() { process.exit(0); }); } catch (ex) { - console.error(ex); + console.error(String(ex)); console.log(usage); process.exit(1); } diff --git a/package.json b/package.json index 3fe9f76..4fb9fce 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "main": "index", "bin": "./index", "engines": { - "node": "~4.4.5" + "node": ">=4.4.5" }, "dependencies": {