Closed
Description
Currently, there is no way to distinguish if the process is being piped/redirected to or if it is spawned by child_process.exec
. The following examples both yield the exact same process.stdin
object, leaving a script undecided whether it should wait for input on stdin if it choses to accept data on stdin:
Attached stdin
echo "something" | iojs -p process.stdin
Spawned by exec
iojs -p "require('child_process').exec('iojs -p process.stdin', function(err,stdout) { process.stdout.write(stdout); })"
If it is possible to distinguish these cases, I'd like to see a new property on process.stdin
that returns true
when the process has its stdin attached, false
if it is not.
related: raineorshine/npm-check-updates#119
cc: @metaraine