A package for creating smart CLI interactions with customizable questions and answers.
dist | ||
test | ||
ts | ||
.gitignore | ||
.gitlab-ci.yml | ||
package.json | ||
README.md | ||
tslint.json |
smartinteract
interact with terminal users
Availabililty
Status for master
Usage
We recommend the use of TypeScript for best in class intellesense
import { SmartInteract } from 'smartinteract'
let myInteract = new SmartInteract([{ // note: its an array. You can specify multiple questions
type: 'input',
message: 'Who are you?',
default: 'Somebody',
choices: { ... }, // optional, only needed if type is 'choice'
validate: (inputString) => { return true } // implement your own validation
}])
SmartInteract.addQuestions([ ... ]) // add more questions
SmartInteract.runQueue()
.then(answersArray => {
// do something with the answers
})