# prompt-sui

> Updated fork of gulp-prompt with more recent inquirer.js

Latest version **3.2.1** (published 2017-08-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install prompt-sui
pnpm add prompt-sui
yarn add prompt-sui
bun add prompt-sui
```

## 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 | 3.2.1 |
| Published | 2017-08-07 |
| First published | 2017-08-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 102 |
| Author | Simon Paitrault |
| Maintainers | semantic-bot |
| Keywords | gulpplugin, prompt |

## Links

- npm: https://www.npmjs.com/package/prompt-sui
- Repository: https://github.com/Freyskeyd/gulp-prompt
- Homepage: https://github.com/Freyskeyd/gulp-prompt#readme
- Issues: https://github.com/Freyskeyd/gulp-prompt/issues
- npm.io page: https://npm.io/package/prompt-sui

## Dependencies (2)

- [inquirer](https://npm.io/package/inquirer.md) 3.2.x
- [event-stream](https://npm.io/package/event-stream.md) ~3.0.20

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 3.2.1 (latest) — 2017-08-07

## README

# Gulp prompt

# THIS REPOSITORY NEED A NEW MAINTAINER

I don't use atom for a while... like 2years and i don't have time to maintain this repository.
If someone wants to be involved, just drop me an email.

Add interaction to gulp tasks.

## .confirm([options])

Options:

 - **message** - Message to be displayed
 - **default** - Default response if none is provided

This method will allow the pipe to continue if the user input is true, otherwise, it will be terminated.

Default usage:
```javascript

gulp.src('test.js')
	.pipe(prompt.confirm())
	.pipe(gulp.dest('dest'));

```

If a string is provided to the options, it will be set as the message:
```javascript

gulp.src('test.js')
	.pipe(prompt.confirm('Are you ready for Gulp?'))
	.pipe(gulp.dest('dest'));

```

Example when using options:
```javascript

gulp.src('test.js')
	.pipe(prompt.confirm({
		message: 'Continue?',
		default: true
	}))
	.pipe(gulp.dest('dest'));

```

## .prompt(questions, callback)

This is a clean pass-through function for gulp to utilize the full [Inquirer.js Library](https://github.com/SBoudrias/Inquirer.js), please refer to them for documentation on corresponding parameters.

Please note that all types are avaiable, not just the examples below.

Example Input:
```javascript

gulp.src('test.js')
	.pipe(prompt.prompt({
		type: 'input',
		name: 'task',
		message: 'Which task would you like to run?'
	}, function(res){
		//value is in res.task (the name option gives the key)
	}));

```

Example Checkbox:
```javascript

gulp.src('test.js')
	.pipe(prompt.prompt({
		type: 'checkbox',
		name: 'bump',
		message: 'What type of bump would you like to do?',
		choices: ['patch', 'minor', 'major']
	}, function(res){
		//value is in res.bump (as an array)
	}));

```

Example Password:
```javascript

gulp.src('test.js')
	.pipe(prompt.prompt({
		type: 'password',
		name: 'pass',
		message: 'Please enter your password'
	}, function(res){
		//value is in res.pass
	}));

```

Example Multiple:
```javascript

gulp.src('test.js')
	.pipe(prompt.prompt([{
		type: 'input',
		name: 'first',
		message: 'First question?'
	},
	{
		type: 'input',
		name: 'second',
		message: 'Second question?'
	}], function(res){
		//value is in res.first and res.second
	}));

```

Example Validation:
```javascript

gulp.src('test.js')
	.pipe(prompt.prompt({
		type: 'password',
		name: 'pass',
		message: 'Please enter your password',
		validate: function(pass){

			if(pass !== '123456'){
				return false;
			}

			return true;
		}
	}, function(res){
		//value is in res.pass
	}));

```

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