Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
653782859c | |||
199b99ae2d | |||
c5e55e8958 | |||
256c53b6f9 | |||
0dae90cc24 | |||
cc65584e9c |
@ -30,15 +30,15 @@ let myInteract = new SmartInteract([{ // note: its an array. You can specify mul
|
|||||||
default: 'Somebody',
|
default: 'Somebody',
|
||||||
validate: (inputString) => { return true } // implement your own validation
|
validate: (inputString) => { return true } // implement your own validation
|
||||||
}])
|
}])
|
||||||
SmartInteract.addQuestions([ ... ]) // add more questions
|
myInteract.addQuestions([ ... ]) // add more questions
|
||||||
SmartInteract.runQueue()
|
myInteract.runQueue()
|
||||||
.then(answerBucket => { // the bucket has all the answers of the completed queue
|
.then(answerBucket => { // the bucket has all the answers of the completed queue
|
||||||
let answerQuestion1 = answerBucket.getAnswerFor('question1')
|
let answerQuestion1 = answerBucket.getAnswerFor('question1')
|
||||||
// do something with the answers
|
// do something with the answers
|
||||||
})
|
})
|
||||||
|
|
||||||
// alternatively use .askQuestion() for more direct control
|
// alternatively use .askQuestion() for more direct control
|
||||||
SmartInteract.askQuestion{ // note: its an array. You can specify multiple questions
|
myInteract.askQuestion{ // note: its an array. You can specify multiple questions
|
||||||
name: 'question2',
|
name: 'question2',
|
||||||
type: 'confirm',
|
type: 'confirm',
|
||||||
message: 'Do you speak English?',
|
message: 'Do you speak English?',
|
||||||
|
7
npmextra.json
Normal file
7
npmextra.json
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"npmci": {
|
||||||
|
"globalNpmTool": [
|
||||||
|
"npmts"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "smartinteract",
|
"name": "smartinteract",
|
||||||
"version": "1.0.1",
|
"version": "1.0.4",
|
||||||
"description": "smart cli interaction",
|
"description": "smart cli interaction",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist/index.d.ts",
|
||||||
@ -25,14 +25,14 @@
|
|||||||
"@types/inquirer": "0.0.31",
|
"@types/inquirer": "0.0.31",
|
||||||
"@types/node": "^6.0.48",
|
"@types/node": "^6.0.48",
|
||||||
"@types/q": "0.0.32",
|
"@types/q": "0.0.32",
|
||||||
"@types/should": "^8.1.30",
|
|
||||||
"inquirer": "^1.2.3",
|
"inquirer": "^1.2.3",
|
||||||
"lik": "^1.0.27",
|
"lik": "^1.0.27",
|
||||||
"q": "^1.4.1",
|
"q": "^1.4.1",
|
||||||
"should": "^11.1.1",
|
|
||||||
"typings-global": "^1.0.14"
|
"typings-global": "^1.0.14"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@types/should": "^8.1.30",
|
||||||
|
"should": "^11.1.1",
|
||||||
"typings-test": "^1.0.3"
|
"typings-test": "^1.0.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user