0.0.11 • Published 9 months ago

@jrc03c/prompt v0.0.11

Weekly downloads
-
License
ISC
Repository
-
Last release
9 months ago

Intro

This is a little package that makes it easy to prompt for user input in a Node program. There are better tools out there, but I just wanted something simple and easy.

Installation

npm install --save @jrc03c/prompt

Usage

The prompt function can be used in Promise mode or callback mode:

const prompt = require("@jrc03c/prompt")

// Promise mode
prompt("Hey! What's your name?").then(name => {
  console.log(`Nice to meet you, ${name}!`)
})

// Callback mode
prompt("Hey! What's your name?", name => {
  console.log(`Nice to meet you, ${name}!`)
})

You can also pass an optional boolean parameter to indicate that the text should be hidden with asterisks, like when typing a password.

const isHidden = true

prompt("Password:", isHidden).then(password => {
  console.log("Your password is:", password)
})
0.0.11

9 months ago

0.0.9

9 months ago

0.0.8

9 months ago

0.0.7

9 months ago

0.0.6

12 months ago

0.0.5

2 years ago

0.0.2

3 years ago

0.0.1

3 years ago