Handles STDIN in JavaScript