2.1 KiB
2.1 KiB
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
})