Skip to content

Instantly share code, notes, and snippets.

@ctaggart
Created November 24, 2013 22:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ctaggart/7633201 to your computer and use it in GitHub Desktop.
Save ctaggart/7633201 to your computer and use it in GitHub Desktop.
///<reference path="DefinitelyTyped\node\node.d.ts" />
import readline = require('readline');
import stream = require('stream');
class ReadLineOptions implements readline.ReadLineOptions {
constructor(public input: stream.ReadableStream, public output: stream.WritableStream) { }
}
var options = new ReadLineOptions(process.stdin, process.stdout);
var rl = readline.createInterface(options);
rl.question('What is your name? ', name => {
console.log('Hi ' + name + '!');
rl.question('press enter to exit', () => rl.close());
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment