# enquirer-helper

> Helper For Enquirer, async-await, Stylish CLI prompts that are user-friendly, intuitive and easy to create.

Latest version **1.1.2** (published 2020-08-18) · ISC license · 0 weekly downloads

## Install

```sh
npm install enquirer-helper
pnpm add enquirer-helper
yarn add enquirer-helper
bun add enquirer-helper
```

## 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.2 |
| Published | 2020-08-18 |
| First published | 2020-06-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 29.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Yotam Hassin |
| Maintainers | yotamhassin |
| Keywords | Helper, Node, Node.JS, NPM, UI/UX, UI, UX, Interface, CLI, Command Line, Command Line Interface, Enquirer, async, await |

## Links

- npm: https://www.npmjs.com/package/enquirer-helper
- Repository: https://github.com/YotamHassin/enquirer-helper
- Homepage: https://github.com/YotamHassin/enquirer-helper#readme
- Issues: https://github.com/YotamHassin/enquirer-helper/issues
- Funding: https://www.patreon.com/YotamHassin
- npm.io page: https://npm.io/package/enquirer-helper

## Dependencies (1)

- [enquirer](https://npm.io/package/enquirer.md) ^2.3.5

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.1.2 (latest) — 2020-08-18
- 1.1.1 — 2020-06-08
- 1.1.0 — 2020-06-08
- 1.0.7 — 2020-06-08
- 1.0.6 — 2020-06-08
- 1.0.5 — 2020-06-08
- 1.0.4 — 2020-06-08
- 1.0.3 — 2020-06-07
- 1.0.2 — 2020-06-07
- 1.0.1 — 2020-06-07

## README

# enquirer-helper
Helper For Enquirer, async-await, Stylish CLI prompts that are user-friendly, intuitive and easy to create.

### [npmjs/enquirer-helper](https://www.npmjs.com/package/enquirer-helper)

### [github/YotamHassin/enquirer-helper](https://github.com/YotamHassin/enquirer-helper)


## Installation 
```sh
cd <my_location>
npm install enquirer-helper --save
```

## Usage

```javascript
const enquirerHelper = require('enquirer-helper');

function myLog(name, ans, desc) {
	var descStr = desc ? ('- ' + desc) : '';
	console.log(name + descStr + ': ', ans);
	console.log();
}

async function run() {
	// AutoComplete
	const t1 = await enquirerHelper.autoComplete('not the defaultSelectMessage', ['option 1', 'option 2']);
	myLog('autoComplete', t1, 'not the default Select Message');

	const t2 = await enquirerHelper.autoComplete(undefined, ['option 1', 'option 2']);
	myLog('autoComplete', t2, 'default Select Message');

	// Confirm
	const t3 = await enquirerHelper.trueFalse('select true or false');
	myLog('trueFalse', t3);

	const t4 = await enquirerHelper.yesNo('select yes or no');
	myLog('yesNo', t4);
	
	// Input
	const t5 = await enquirerHelper.input('input text');
	myLog('input', t5);

	// Number
	//int: Input.int, float: Input.float, 
	const t6 = await enquirerHelper.int('input integer');
	myLog('int', t6);

	const t7 = await enquirerHelper.float('input float');
	myLog('float', t7);

	// Secure 
	//invisible: Input.invisible, password: Input.password, 
	const t8 = await enquirerHelper.invisible('input don\'t show chars');
	myLog('invisible', t8);
	
	const t9 = await enquirerHelper.password('show chars as stars');
	myLog('password', t9);

	// Select
	const t10 = await enquirerHelper.select(['option 1', 'option 2']);
	myLog('select', t10);

	const t11 = await enquirerHelper.selectWithMessage('select With custom Message', ['option 1', 'option 2']);
	myLog('selectWithMessage', t11);

	const t12 = await enquirerHelper.multi(['option 1', 'option 2']);
	myLog('multi', t12, 'select');

	const t13 = await enquirerHelper.multiWithMessage('multi select With custom Message', ['option 1', 'option 2']);
	myLog('multiWithMessage', t13, 'select');

	const t14 = await enquirerHelper.sort('sort some array', ['option 1', 'option 2', 'option 3']);
	myLog('sort', t14);

	const t15 = await enquirerHelper.runSingle({
		'single async option': async () => { console.log(await enquirerHelper.input('')); },
		'single option 2': () => { console.log('print option num 2'); },
		'single option number 3': () => { console.log('and so on and so forth'); },
	});
	myLog('runSingle', t15, 'run action and return a value');

	await enquirerHelper.loopCommand({
		'loop option 1': () => { console.log('print option 1'); },
		'loop async option 2': async () => { 
			console.log('print option num 2', 
			await enquirerHelper.input('this is a loop, wht you say about it?')); 
		},
		'loop option number 3': () => { console.log('and so on and so forth'); },
	});
	
	//myLog('loopCommand will Not return any usefull value, void action', t16);
	myLog('loopCommand will Not return any usefull value, void action');
}

var r = run();
r.catch(reason => {
	if (reason) {
		console.error('catch in tests with reason', reason);
	}
	else {
		console.log('catch in tests');		
		process.exit();
	}
});
r.then(() => { 
	console.log('then in tests'); 
});
//r.finally(() => { console.log('finally in tests'); });

```

## Join me on the quest to make Computer, Software and Development Simple.

## [Patreon/YotamHassin](https://www.patreon.com/YotamHassin)

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