Skip to content

Instantly share code, notes, and snippets.

@korzio
Created April 6, 2019 09:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save korzio/f358445dca482dccd3853561f04a0512 to your computer and use it in GitHub Desktop.
Save korzio/f358445dca482dccd3853561f04a0512 to your computer and use it in GitHub Desktop.
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