New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

read-cli-input

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

read-cli-input

Read user input from CLI for specified amount of lines.

0.1.0
Source
npm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

read-cli-input

Read user input from CLI for specified amount of lines.

Install

$ npm install read-cli-input

Usage

var read = require('read-cli-input')

console.log("What are your most favorite 3 food ?");

read(3, function (input) {
  console.log('Answer was: ', input.join(', '));
  // => Answer was Falafel, ramen, babi guling
})

By default, it reads from process.stdin. You can specify custom IO if you pass three arguments;

read(process.stdin, 3, console.log);

If you'll read just one line from process.stdin, you can just pass a callback:

read(console.log);

Keywords

io

FAQs

Package last updated on 27 Sep 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts