jashkenas/coffee-script — pull request #2002 by TrevorBurnham (2012-01-03 22:29:40+00:00)
Title: Fixes #2001: Allow piped input to coffee

This is a fairly simple patch that allows you to write

echo "console.log 'foo'" | coffee

and get the output

coffee> console.log 'foo'

foo

This patch isn't ideal; it just passes all of the piped input straight to `CoffeeScript.eval`. Unfortunately, the `readline` module that we're using for the REPL doesn't seem to take anything but a true `stdin`, so there's no easy way that I can think of to allow an arbitrary pipe to interact with the REPL. Still, it's an improvement compared to the error Michael reported at #2001.