Replaces 'new Buffer' with 'Buffer.from'

This commit is contained in:
Zachary Boyd 2018-05-06 09:29:18 -07:00
parent 8275a462dc
commit c08ef63867
2 changed files with 3 additions and 3 deletions

View file

@ -1,6 +1,6 @@
{
"name": "tor-router",
"version": "3.2.1",
"version": "3.2.2",
"main": "src/index.js",
"repository": "git@github.com:znetstar/tor-router.git",
"author": "Zachary Boyd <zachary@zacharyboyd.nyc>",

View file

@ -76,7 +76,7 @@ class TorProcess extends EventEmitter {
});
tor.stderr.on('data', (data) => {
let error_message = new Buffer(data).toString('utf8');
let error_message = Buffer.from(data).toString('utf8');
this.emit('error', new Error(error_message));
});
@ -87,7 +87,7 @@ class TorProcess extends EventEmitter {
});
tor.stdout.on('data', (data) => {
let text = new Buffer(data).toString('utf8');
let text = Buffer.from(data).toString('utf8');
let msg = text.split('] ').pop();
if (text.indexOf('Bootstrapped 100%: Done') !== -1){
this.emit('ready');