Synchronous Readline for interactively running to have a conversation with the user via a console(TTY).
Find a file
2013-08-29 19:55:23 +09:00
lib Initial commit 2013-08-29 19:55:23 +09:00
.gitignore Initial commit 2013-08-29 19:55:23 +09:00
LICENSE-MIT Initial commit 2013-08-29 19:55:23 +09:00
package.json Initial commit 2013-08-29 19:55:23 +09:00
README.md Initial commit 2013-08-29 19:55:23 +09:00

readline-sync

Synchronous Readline.question for interactively running.

Example

var readlineSync = require('readline-sync');

var answer = readlineSync('What is your favorite food? :');
console.log('Oh, so your favorite food is ' + answer);

Installation

npm install -g readline-sync

Usage

answer = readlineSync([prompt[, encoding]])

require('readline-sync') returns a Function. Displays the prompt to the user if it is given, and then returns the user's response after it has been typed.
encoding specify encoding method of input (user's response) and output (prompt). Defaults to 'utf8'.

Release History

  • 2013-08-29 v0.1.0 Initial release.