Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
8b6a15388e | |||
0a3b006139 | |||
1f4f9c0c44 | |||
9420815809 |
@ -1,5 +1,11 @@
|
|||||||
|
# gitzone standard
|
||||||
image: hosttoday/ht-docker-node:npmci
|
image: hosttoday/ht-docker-node:npmci
|
||||||
|
|
||||||
|
cache:
|
||||||
|
paths:
|
||||||
|
- .yarn/
|
||||||
|
key: "$CI_BUILD_STAGE"
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- test
|
- test
|
||||||
- release
|
- release
|
||||||
@ -10,6 +16,7 @@ testLEGACY:
|
|||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- npmci test legacy
|
- npmci test legacy
|
||||||
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
@ -18,6 +25,7 @@ testLTS:
|
|||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- npmci test lts
|
- npmci test lts
|
||||||
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
|
||||||
@ -25,6 +33,7 @@ testSTABLE:
|
|||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- npmci test stable
|
- npmci test stable
|
||||||
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
|
||||||
@ -47,13 +56,17 @@ trigger:
|
|||||||
- docker
|
- docker
|
||||||
|
|
||||||
pages:
|
pages:
|
||||||
image: hosttoday/ht-docker-node:npmpage
|
image: hosttoday/ht-docker-node:npmci
|
||||||
stage: pages
|
stage: pages
|
||||||
script:
|
script:
|
||||||
- npmci command npmpage --host gitlab
|
- npmci command yarn global add npmpage
|
||||||
|
- npmci command npmpage
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
only:
|
only:
|
||||||
- tags
|
- tags
|
||||||
artifacts:
|
artifacts:
|
||||||
expire_in: 1 week
|
expire_in: 1 week
|
||||||
paths:
|
paths:
|
||||||
- public
|
- public
|
||||||
|
allow_failure: true
|
||||||
|
53
README.md
53
README.md
@ -1,15 +1,16 @@
|
|||||||
# smartinteract
|
# smartinteract
|
||||||
interact with terminal users
|
smart cli interaction
|
||||||
|
|
||||||
## Availabililty
|
## Availabililty
|
||||||
[](https://www.npmjs.com/package/smartinteract)
|
[](https://www.npmjs.com/package/smartinteract)
|
||||||
[](https://gitlab.com/pushrocks/smartinteract)
|
[](https://GitLab.com/pushrocks/smartinteract)
|
||||||
[](https://github.com/pushrocks/smartinteract)
|
[](https://github.com/pushrocks/smartinteract)
|
||||||
[](https://pushrocks.gitlab.io/smartinteract/)
|
[](https://pushrocks.gitlab.io/smartinteract/)
|
||||||
|
|
||||||
## Status for master
|
## Status for master
|
||||||
[](https://gitlab.com/pushrocks/smartinteract/commits/master)
|
[](https://GitLab.com/pushrocks/smartinteract/commits/master)
|
||||||
[](https://gitlab.com/pushrocks/smartinteract/commits/master)
|
[](https://GitLab.com/pushrocks/smartinteract/commits/master)
|
||||||
|
[](https://www.npmjs.com/package/smartinteract)
|
||||||
[](https://david-dm.org/pushrocks/smartinteract)
|
[](https://david-dm.org/pushrocks/smartinteract)
|
||||||
[](https://www.bithound.io/github/pushrocks/smartinteract/master/dependencies/npm)
|
[](https://www.bithound.io/github/pushrocks/smartinteract/master/dependencies/npm)
|
||||||
[](https://www.bithound.io/github/pushrocks/smartinteract)
|
[](https://www.bithound.io/github/pushrocks/smartinteract)
|
||||||
@ -18,39 +19,11 @@ interact with terminal users
|
|||||||
[](http://standardjs.com/)
|
[](http://standardjs.com/)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
We recommend the use of TypeScript for best in class intellesense
|
Use TypeScript for best in class instellisense.
|
||||||
|
|
||||||
```javascript
|
For further information read the linked docs at the top of this README.
|
||||||
import { SmartInteract } from 'smartinteract'
|
|
||||||
|
|
||||||
let myInteract = new SmartInteract([{ // note: its an array. You can specify multiple questions
|
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||||
name: 'question1',
|
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
||||||
type: 'input',
|
|
||||||
message: 'Who are you?',
|
|
||||||
default: 'Somebody',
|
|
||||||
validate: (inputString) => { return true } // implement your own validation
|
|
||||||
}])
|
|
||||||
myInteract.addQuestions([ ... ]) // add more questions
|
|
||||||
myInteract.runQueue()
|
|
||||||
.then(answerBucket => { // the bucket has all the answers of the completed queue
|
|
||||||
let answerQuestion1 = answerBucket.getAnswerFor('question1')
|
|
||||||
// do something with the answers
|
|
||||||
})
|
|
||||||
|
|
||||||
// alternatively use .askQuestion() for more direct control
|
[](https://push.rocks)
|
||||||
myInteract.askQuestion{ // note: its an array. You can specify multiple questions
|
|
||||||
name: 'question2',
|
|
||||||
type: 'confirm',
|
|
||||||
message: 'Do you speak English?',
|
|
||||||
default: true,
|
|
||||||
validate: (inputString) => { return true } // implement your own validation
|
|
||||||
}().then(answerObject => {
|
|
||||||
// answerObject looks like { name: 'question2', value: true }
|
|
||||||
})
|
|
||||||
```
|
|
||||||
|
|
||||||
### Environment
|
|
||||||
In some environments like CI there is no user input to be expected.
|
|
||||||
smartinteract will always directyl create an answer from the default value
|
|
||||||
|
|
||||||
[](https://push.rocks)
|
|
||||||
|
60
docs/index.md
Normal file
60
docs/index.md
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
# smartinteract
|
||||||
|
smart cli interaction
|
||||||
|
|
||||||
|
## Availabililty
|
||||||
|
[](https://www.npmjs.com/package/smartinteract)
|
||||||
|
[](https://GitLab.com/pushrocks/smartinteract)
|
||||||
|
[](https://github.com/pushrocks/smartinteract)
|
||||||
|
[](https://pushrocks.gitlab.io/smartinteract/)
|
||||||
|
|
||||||
|
## Status for master
|
||||||
|
[](https://GitLab.com/pushrocks/smartinteract/commits/master)
|
||||||
|
[](https://GitLab.com/pushrocks/smartinteract/commits/master)
|
||||||
|
[](https://www.npmjs.com/package/smartinteract)
|
||||||
|
[](https://david-dm.org/pushrocks/smartinteract)
|
||||||
|
[](https://www.bithound.io/github/pushrocks/smartinteract/master/dependencies/npm)
|
||||||
|
[](https://www.bithound.io/github/pushrocks/smartinteract)
|
||||||
|
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||||
|
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||||
|
[](http://standardjs.com/)
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
Use TypeScript for best in class instellisense.
|
||||||
|
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
import { SmartInteract } from 'smartinteract'
|
||||||
|
|
||||||
|
let myInteract = new SmartInteract([{ // note: its an array. You can specify multiple questions
|
||||||
|
name: 'question1',
|
||||||
|
type: 'input',
|
||||||
|
message: 'Who are you?',
|
||||||
|
default: 'Somebody',
|
||||||
|
validate: (inputString) => { return true } // implement your own validation
|
||||||
|
}])
|
||||||
|
myInteract.addQuestions([ ... ]) // add more questions
|
||||||
|
myInteract.runQueue()
|
||||||
|
.then(answerBucket => { // the bucket has all the answers of the completed queue
|
||||||
|
let answerQuestion1 = answerBucket.getAnswerFor('question1')
|
||||||
|
// do something with the answers
|
||||||
|
})
|
||||||
|
|
||||||
|
// alternatively use .askQuestion() for more direct control
|
||||||
|
myInteract.askQuestion{ // note: its an array. You can specify multiple questions
|
||||||
|
name: 'question2',
|
||||||
|
type: 'confirm',
|
||||||
|
message: 'Do you speak English?',
|
||||||
|
default: true,
|
||||||
|
validate: (inputString) => { return true } // implement your own validation
|
||||||
|
}().then(answerObject => {
|
||||||
|
// answerObject looks like { name: 'question2', value: true }
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
For further information read the linked docs at the top of this README.
|
||||||
|
|
||||||
|
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||||
|
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
||||||
|
|
||||||
|
[](https://push.rocks)
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "smartinteract",
|
"name": "smartinteract",
|
||||||
"version": "1.0.7",
|
"version": "1.0.9",
|
||||||
"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",
|
||||||
|
Reference in New Issue
Block a user