Socket
Book a DemoInstallSign in
Socket

readline-prompter

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

readline-prompter

Easily prompt the user with a series of questions.

0.2.0
latest
npmnpm
Version published
Maintainers
1
Created
Source

Node.js - readline-prompter

build status

Easily prompt the user with a series of questions.

Why?

I wanted a package that I could easily specify an array of words and then have it ask a series of questions. Now you can be a bit more productive.

Installation

npm install readline-prompter

Node Versions

There is an error with the test on Node v0.6. Not sure what's causing it.

Example

var rlp = require('readline-prompter');

var tokens = ['first name', 'last name', 'cats name'];
var def = {'first name': 'JP'};
var skip = {'cats name': 'petey'};


rlp(tokens, def, skip).end(function(results) {
    console.log(results);
});

The default for 'first name' is "JP" in this case. 'cats name' gets skipped. You would have to type in something for 'last name', it won't let you skip it.

Console:

first name: (JP)
last name:

Output:

{
    "first name": "JP",
    "last name": "Richardson",
    "cats name": "petey"
}

Author

node-readline-prompter was written by JP Richardson. You should follow him on Twitter @jprichardson. Also read his coding blog Procbits. If you write software with others, you should checkout Gitpilot to make collaboration with Git simple.

License

(MIT License)

Copyright 2012, JP Richardson jprichardson@gmail.com

Keywords

readline

FAQs

Package last updated on 01 May 2013

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.