0.1.3 • Published 4 years ago

castle v0.1.3

Weekly downloads
3
License
ISC
Repository
github
Last release
4 years ago

Castle

Terminal utils for happy scripting

Build Status

Installing

npm install castle

API

castle.prompt(message, options);

message (string, required) — message to display options (object, optional) — see options below:

optiontypedefault valuedescription
allowEmptybooleantrueIf false will ask again on empty input
defaultValuestringundefinedUses default value on empty input
stylestringprompt.Style.DefaultSpecifies prompt color, supported values: prompt.Style.Default, prompt.Style.Dangerous (red)
const {prompt} = require('castle');

prompt('Your name');
const name = await prompt('Your name', {defaultValue: 'Anonymous'});

castle.confirm(message, options);

message (string, required) — message to display options (object, optional) — see options below:

optiontypedefault valuedescription
allowEmptybooleantrueIf false will ask again on empty input, otherwise treats empty input as negative answer
defaultValuebooleanundefinedUses default value on empty input
stylestringprompt.Style.DefaultSpecifies prompt color, supported values: confirm.Style.Default, confirm.Style.Dangerous (red)
const {confirm} = require('castle');

const isConfirmed = await confirm('Proceed?');
0.1.3

4 years ago

0.1.0

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.0.1

9 years ago

0.0.0

11 years ago