process: make --eval and reading scripts from stdin act the same
authorNathan Rajlich <nathan@tootallnate.net>
Tue, 24 Apr 2012 08:34:17 +0000 (01:34 -0700)
committerNathan Rajlich <nathan@tootallnate.net>
Tue, 24 Apr 2012 18:30:14 +0000 (11:30 -0700)
commit0b5235e68c7f62116a27ea27d4aeb4fc6b211cf4
tree14327c77d4c2c5c8efb57941e40a6e5137b0b7b3
parentd9bad09ede9603d89c3dddd62d811bebefa73d50
process: make --eval and reading scripts from stdin act the same

Reusing the same logic for both places for the behavior is consistent.

For example:

  $ ./node -p -e "'Hello World'"
  Hello World

  $ echo "'Hello World'" | ./node -p
  Hello World
src/node.js