Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/osmanmesutozcan/inquirer-confirm-warning

Custom confirm inquerer prompt that warns if the condition is met.
https://github.com/osmanmesutozcan/inquirer-confirm-warning

inquirer plop warning

Last synced: 5 days ago
JSON representation

Custom confirm inquerer prompt that warns if the condition is met.

Awesome Lists containing this project

README

        


Custom confirm prompt for inquirer that warns if the conditions are met.




### Installation
```
npm install inquirer-confirm-warning
```

```
inquirer.registerPrompt('warning', require('inquirer-confirm-warning'));
```
If using with [plop](https://github.com/amwmedia/plop) then in your plop config:

```
plop.addPrompt('warning', require('inquirer-confirm-warning'));
```

### Examples

You can see it in action.

Get to the examples folder and run:

```
node example/simple_example.js
```

### Usage

Take `type`, `name`, `message`, `[default: Bool, warnif: Bool, warning: String]` properties.

Takes [chalk](https://github.com/chalk/chalk) color names (e.g `white`, `yellow`, `red`).

```
inquirer.prompt({
type: 'warning',
message: message
warning: 'Some sort of warning!',
color: 'yellow',
warnif: true
});
```