Skip to content

Instantly share code, notes, and snippets.

View dresende's full-sized avatar
🎯
Focusing

Diogo Resende dresende

🎯
Focusing
View GitHub Profile

Readline

To use this module, do require('readline').

rl.createInterface(input, output, completer)

Takes two streams and creates a readline interface. The completer function is used for autocompletion. When given a substring, it returns [substr, completedStr]. TODO: write some code to make sure I'm right.

createInterface is commonly used with process.stdin and process.stdout in order to accept user input: