smartinteract/README.md
2016-11-20 01:11:22 +01:00

2.1 KiB

smartinteract

interact with terminal users

Availabililty

npm git git docs

Status for master

build status coverage report Dependency Status bitHound Dependencies bitHound Code TypeScript node JavaScript Style Guide

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