Closed davidmarkclements closed 8 years ago
0
fs.readSync(process.stdin.fd, 'rs')
So,
if v0.12+ OR windows we read from process.stdin.fd if < 0.12 AND NOT windows we read from /dev/tty
Note: Edge case - will fail in REPL in windows (EBADF)
0
) on all platformsfs.readSync(process.stdin.fd, 'rs')
works on Windows, on Node v0.10+fs.readSync(process.stdin.fd, 'rs')
works on non-windows on Node 0.12+ (at least tested on OS X)So,
if v0.12+ OR windows we read from process.stdin.fd if < 0.12 AND NOT windows we read from /dev/tty
Note: Edge case - will fail in REPL in windows (EBADF)