An open API service indexing awesome lists of open source software.

https://github.com/iansu/node-prompts

A POC of a Node.js implementation of the Web APIs for alert, confirm and prompt
https://github.com/iansu/node-prompts

Last synced: about 2 months ago
JSON representation

A POC of a Node.js implementation of the Web APIs for alert, confirm and prompt

Awesome Lists containing this project

README

        

# Node Prompts

A POC of a Node.js implementation of the Web APIs for alert, confirm and prompt

## Usage

### Alert

```js
await alert('Please confirm');
```

### Confirm

```js
const result = await confirm('Are you sure?');

if (result) {
// do something
}
```

### Prompt

```js
// prompt with no default value
const result = await prompt('What is your name?');
console.log(result);

// prompt with a default value
const resultWithDefault = await prompt('What is your age?', 18);
console.log(resultWithDefault);
```