# simple-prompts-web3

> Lightweight, beautiful and user-friendly prompts and live on Webiste. With future web3 very simple library

Latest version **1.0.1** (published 2024-02-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install simple-prompts-web3
pnpm add simple-prompts-web3
yarn add simple-prompts-web3
bun add simple-prompts-web3
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2024-02-29 |
| First published | 2024-02-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >= 14 |
| Dependencies | 2 |
| Unpacked size | 77.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Assitnews |
| Maintainers | phienbanbk783 |
| Keywords | ui, prompts, cli, prompt, interface, command-line, input, command, stdin, menu, ask, interact |

## Links

- npm: https://www.npmjs.com/package/simple-prompts-web3
- Repository: https://github.com/assitnewssed/simple-prompts-web3
- Homepage: https://github.com/assitnewssed/simple-prompts-web3#readme
- Issues: https://github.com/assitnewssed/simple-prompts-web3/issues
- npm.io page: https://npm.io/package/simple-prompts-web3

## Dependencies (2)

- [kleur](https://npm.io/package/kleur.md) ^4.0.1
- [sisteransi](https://npm.io/package/sisteransi.md) ^1.0.5

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2024-02-29
- 1.0.0 — 2024-02-29

## README

## ❯ Install

```
$ npm install --save simple-prompts-web3
```

> This package supports Node 14 and above

## ❯ Usage

```js
const simple-prompts-web3 = require('simple-prompts-web3');

(async () => {
  const response = await simple-prompts-web3({
    type: 'number',
    name: 'value',
    message: 'How old are you?',
    validate: value => value < 18 ? `Nightclub is 18+ only` : true
  });

  console.log(response); // => { value: 24 }
})();
```

## ❯ Examples

### Single Prompt

Prompt with a single prompt object. Returns an object with the response.

```js
const simple-prompts-web3 = require('simple-prompts-web3');

(async () => {
  const response = await simple-prompts-web3({
    type: 'text',
    name: 'meaning',
    message: 'What is the meaning of life?'
  });

  console.log(response.meaning);
})();
```

### Prompt Chain

Prompt with a list of prompt objects. Returns an object with the responses.
Make sure to give each prompt a unique `name` property to prevent overwriting values.

```js
const simple-prompts-web3 = require('simple-prompts-web3');

const questions = [
  {
    type: 'text',
    name: 'username',
    message: 'What is your GitHub username?'
  },
  {
    type: 'number',
    name: 'age',
    message: 'How old are you?'
  },
  {
    type: 'text',
    name: 'about',
    message: 'Tell something about yourself',
    initial: 'Why should I?'
  }
];

(async () => {
  const response = await simple-prompts-web3(questions);

  // => response => { username, age, about }
})();
```

### Dynamic simple-prompts-web3

Prompt properties can be functions too.
Prompt Objects with `type` set to `falsy` values are skipped.

```js
const simple-prompts-web3 = require('simple-prompts-web3');

const questions = [
  {
    type: 'text',
    name: 'dish',
    message: 'Do you like pizza?'
  },
  {
    type: prev => prev == 'pizza' ? 'text' : null,
    name: 'topping',
    message: 'Name a topping'
  }
];

(async () => {
  const response = await simple-prompts-web3(questions);
})();
```

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