GitXplorerGitXplorer
c

just-ask

public
3 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
c2bc346f6e0ea2f63c6e9478a771652aff7c25b2

Updated test.

ccodealchemist committed 8 years ago
Unverified
2283a1007bf3a8aa3a3b58f1551c826ffcb783d4

updated readme

committed 8 years ago
Unverified
bc8b400ae3c19d97a08a6683c4c3042bfd384cc9

1.1.0

committed 8 years ago
Unverified
138fdab326347adbeae1fec98e05fc40988b96dd

Using read instead of readline; added password handling.

committed 8 years ago
Unverified
934798cfd9f27c9e66fa27577a1fe7ab65d6945b

added readme

ccodealchemist committed 8 years ago
Unverified
60cdca5a0b9ee915b8da9607c60f8a5ce797b10e

added repo to package.json

ccodealchemist committed 8 years ago

README

The README file for this repository.

just-ask

Ask a question on the command line, get the answer in a promise.

Install

npm install --save just-ask

Usage

Ask a question (chars shown on screen as user types):

const ask = require('just-ask')
ask('Would you like to get a promise?').then((answer) => {
  console.log(`Your answer: ${answer}`)
})

Ask for a password (chars replaced by set char as user types):

const ask = require('just-ask')
ask('What is your password?', '*').then((answer) => {
  console.log(`Your password: ${answer}`)
})

Note that you can use any char you want, or even an empty space:

ask('What is your password?', ' ')

Why?

I wanted a dead simple and super lightweight module to get data from the user on the command line which works with promises. This is it.