From 0d41a632634dd70783457ac06717ed95f7353d8f Mon Sep 17 00:00:00 2001 From: Kai Jauslin Date: Tue, 12 Jun 2018 17:14:46 +0100 Subject: [PATCH] NodeJS 10.x compatibility --- index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 5eb8a88..85952c3 100644 --- a/index.js +++ b/index.js @@ -41,7 +41,7 @@ GogoShell.prototype = _.create(Socket.prototype, { Socket.prototype.connect.call(this, config); return new Promise(function(resolve, reject) { - instance.once('ready', resolve); + instance.once('gogo-ready', resolve); }); }, @@ -111,7 +111,7 @@ GogoShell.prototype = _.create(Socket.prototype, { instance.removeListener(STR_DATA, dataListener); - instance.emit('ready'); + instance.emit('gogo-ready'); } }; @@ -123,9 +123,9 @@ GogoShell.prototype = _.create(Socket.prototype, { }); } - this.write(new Buffer([255, 251, 24])); + this.write(Buffer.from([255, 251, 24])); - this.write(new Buffer([255, 250, 24, 0, 86, 84, 50, 50, 48, 255, 240])); + this.write(Buffer.from([255, 250, 24, 0, 86, 84, 50, 50, 48, 255, 240])); }, _parseHelpCommandData: function(data, command) {