Created
April 6, 2019 09:52
-
-
Save korzio/f358445dca482dccd3853561f04a0512 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { promisify } = require('util') | |
const prompt = require('prompt') | |
const get = promisify(prompt.get) | |
function start() { | |
prompt.start() | |
get( | |
questions | |
.map(({ question }, i) => ({ name: `${i}`, description: question })) | |
) | |
.then((result) => { | |
console.log('Command-line input received:') | |
console.log(JSON.stringify(result)) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment