Closed EyalAr closed 9 years ago
Hm. I would be much more inclined to include things like this if this module was not auto loaded by browserify. The issue right now is that any extra code into this module will increase the bundle size for basically everyone. Is that correct @substack?
tl;dr: I realize you want to keep this module small. Feel free to reject this PR; in which case I'll maintain my own shim.
This PR adds
write
methods toprocess.stdout
/process.stderr
which simulate the corresponding methods in Node.The new
write
methods:‘\r’
,‘\b’
,‘\n’
)console.log
/console.error
as proxies forstdout.write
/stderr.write
Example:
Will print (exactly as in Node):
While doing the same with
console.log
will print:Note:
Prints are buffered until a
'\n'
char is encountered. Soprocess.stdout.write('foo')
will print nothing.