update core nodes to use newer Buffer syntax

This commit is contained in:
Dave Conway-Jones
2017-06-24 13:53:45 +01:00
parent 395210e4f0
commit a824caf712
4 changed files with 21 additions and 21 deletions

View File

@@ -86,7 +86,7 @@ module.exports = function(RED) {
child.stderr.on('data', function (data) {
if (node.activeProcesses.hasOwnProperty(child.pid) && node.activeProcesses[child.pid] !== null) {
if (isUtf8(data)) { msg.payload = data.toString(); }
else { msg.payload = new Buffer(data); }
else { msg.payload = new Buffer.from(data); }
node.send([null,RED.util.cloneMessage(msg),null]);
}
});
@@ -121,7 +121,7 @@ module.exports = function(RED) {
/* istanbul ignore else */
if (RED.settings.verbose) { node.log(cl); }
child = exec(cl, {encoding: 'binary', maxBuffer:10000000}, function (error, stdout, stderr) {
msg.payload = new Buffer(stdout,"binary");
msg.payload = new Buffer.from(stdout,"binary");
if (isUtf8(msg.payload)) { msg.payload = msg.payload.toString(); }
var msg2 = null;
if (stderr) {