Skip to content

Commit

Permalink
[fix] Use Buffer.alloc and Buffer.from instead of new Buffer (winston…
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisAlderson authored and indexzero committed Apr 20, 2018
1 parent ef4f721 commit ae72afc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/winston/tail-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function nop() {}
// `tail -f` a file. Options must include file.
//
module.exports = function tailFile(options, iter) {
const buffer = new Buffer(64 * 1024);
const buffer = Buffer.alloc(64 * 1024);
const decode = new StringDecoder('utf8');
const stream = new Stream();
let buff = '';
Expand Down
2 changes: 1 addition & 1 deletion lib/winston/transports/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,5 +202,5 @@ Http.prototype._request = function (options, callback) {
}).resume();
});

req.end(new Buffer(JSON.stringify(options), 'utf8'));
req.end(Buffer.from(JSON.stringify(options), 'utf8'));
};

0 comments on commit ae72afc

Please sign in to comment.