package
Input module for Listr
npm install listr-inputGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Input module for Listr
$ npm install --save listr-inputconst Listr = require('listr');
const input = require('listr-input');
const got = require('got');
const list = new Listr([
{
title: 'Retrieving data',
task: () => input('Credentials', {
secret: true,
validate: value => value.length > 0,
done: credentials => got('https://myapi.com', {
headers: {
'Authorization':
Returns an Observable which asks for user input.
Type: string
Question to ask.
Type: string
Default value to use if nothing is entered.
Type: function
Function which accepts the provided value. Should return true if the value is valid, false otherwise.
Type: boolean
Default: false
Mark the input as secret.
Type: function
Function that will be invoked when the user has answered the question.
Type: function
Function which accepts the provided value. If returns true then the value will be submitted automatically.
MIT © Sam Verschueren