Closed
Description
- Version: v6.2.1
- Platform: Darwin Kernel Version 15.5.0
- Subsystem: child_process
Somewhere between node v6.2.0 and v6.2.1 the encoding of the data passed to the 'on data' callback for the child_process.exec.stdout stream seems to have changed from String to Buffer.
Was this an intentional change, and what is the recommended way of setting the encoding for the exec stdout/stdio stream?
Thanks
Code example:
var exec = require('child_process').exec;
var keepAlive = setInterval(() => {}, 1000000000);
var e = exec('ls');
e.stdout.on('data', function(data) {
console.log('data: ', typeof data, data instanceof Buffer);
clearInterval(keepAlive);
});
with v6.2.0, output is data: string false
with v6.2.1, output is data: object true