Generated from @types/prompts v2.0.8 by dts2hx modified and maintained by @inc0der for use in @LunaTechsDev organization
Still in early development and may have inconsistencies
Prompts is a Lightweight, beautiful and user-friendly interactive prompts API that let' you enquire user's in your CLI application.
- Simple: prompts has no big dependencies nor is it broken into a dozen tiny modules that only work well together.
- User friendly: prompt uses layout and colors to create beautiful cli interfaces.
- Promised: uses promises and async/await. No callback hell.
- Flexible: all prompts are independent and can be used on their own.
- Testable: provides a way to submit answers programmatically.
- Unified: consistent experience across all prompts.
With lix:
lix install gh:inc0der/hxprompts
With Haxelib
haxelib git hxprompts https://github.com/inc0der/hxprompts.git master
import prompts.Prompter;
class GuidedSetup {
public static function main() {
Prompter.call([
{
type: 'text',
name: 'cwd',
message: 'Where would you like to create the project?',
initial: './',
format: (v) -> Path.resolve(v)
},
{
type: 'text',
name: 'projectName',
message: 'Project name',
initial: 'generated-project'
},
]).then((answers: Dynamic) -> {
if (!FileSystem.exists(answers.cwd)) {
FileSystem.createDirectory(answers.cwd);
Sys.setCwd(answers.cwd);
}
})
}
}