ask icon indicating copy to clipboard operation
ask copied to clipboard

Receive user input via the command line

ask

This package is perfect for asking the users of your command line interface to provide a certain kind of information that's needed for continuing with execution of the program.

Although it's not a explicit requirement, the package works best when used in combination with args.

Usage

Firstly, install the package:

npm install --save ask

Once you're done, you can start using it:

import { prompt } from 'ask'

const answers = await prompt([
  {
    name: 'author',
    message: 'Who are you?'
  }
])

Contribute

  1. Fork this repository to your own GitHub account and then clone it to your local device
  2. Link the package to the global module directory: npm link
  3. Transpile the source code and watch for changes: npm start
  4. Within the module you want to test your local development instance of ask, just link it to the dependencies: npm link ask. Instead of the default one from npm, node will now use your clone of ask!

As always, you can run the AVA and ESLint tests using: npm test