Skip to content

Commit

Permalink
Using Buffer.from() and removing deprecated new Buffer() #145
Browse files Browse the repository at this point in the history
  • Loading branch information
Apoorva-GA committed May 21, 2018
1 parent 839d68e commit 0a3cfdc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/connection.js
Expand Up @@ -15,7 +15,7 @@ var ExecutionConnection = function (host, port, message) {
};

var messageHandler = function (bytes) {
var r = reader.create(new Buffer(bytes));
var r = reader.create(Buffer.from(bytes));
while (r.pos < r.len) {
self.emit("messageReceived", self.message.decodeDelimited(r));
}
Expand Down
2 changes: 1 addition & 1 deletion src/screenshot.js
Expand Up @@ -11,7 +11,7 @@ var screenshot = function (tmpfile) {
return "";
}
try {
return new Buffer(fs.readFileSync(tmpfile)).toString("base64");
return Buffer.from(fs.readFileSync(tmpfile)).toString("base64");
} catch (e) {
console.log(e.toString());
return "";
Expand Down

0 comments on commit 0a3cfdc

Please sign in to comment.