# just-ask

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

Latest version **1.1.0** (published 2017-03-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install just-ask
pnpm add just-ask
yarn add just-ask
bun add just-ask
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2017-03-23 |
| First published | 2017-02-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Alberto Miranda |
| Maintainers | codealchemist |
| Keywords | ask, promise |

## Links

- npm: https://www.npmjs.com/package/just-ask
- Repository: https://github.com/codealchemist/just-ask
- Homepage: https://github.com/codealchemist/just-ask#readme
- Issues: https://github.com/codealchemist/just-ask/issues
- npm.io page: https://npm.io/package/just-ask

## Dependencies (1)

- [read](https://npm.io/package/read.md) ^1.0.7

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 1.1.0 (latest) — 2017-03-23
- 1.0.0 — 2017-02-12

## README

# 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.

---
_Source: https://npm.io/package/just-ask · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
