What is listr-verbose-renderer?
The listr-verbose-renderer npm package is a renderer for Listr, a Node.js library that helps you create a list of tasks with a beautiful output. The verbose renderer outputs more detailed information for each task, making it suitable for debugging or when more information about the task execution is needed.
What are listr-verbose-renderer's main functionalities?
Verbose Output
This feature allows for detailed output during the execution of tasks. Each task's start, end, and output are logged to the console, providing a clear and verbose description of what is happening.
const Listr = require('listr');
const VerboseRenderer = require('listr-verbose-renderer');
const tasks = new Listr([
{
title: 'Task 1',
task: () => Promise.resolve('Result of task 1')
},
{
title: 'Task 2',
task: () => Promise.resolve('Result of task 2')
}
], { renderer: VerboseRenderer });
tasks.run();
Other packages similar to listr-verbose-renderer
listr-update-renderer
This package is another renderer for Listr that provides an updating output, which is less verbose than listr-verbose-renderer. It updates the status of tasks in place, which is more suitable for scenarios where a concise output is preferred.
listr-silent-renderer
The listr-silent-renderer is designed for scenarios where no output is desired. It suppresses all task messages, which contrasts with listr-verbose-renderer that provides detailed information about each task's execution.
ora
Ora is a terminal spinner library that provides a way to indicate progress for long-running tasks. While it does not structure tasks in a list like Listr, it can be used to give users feedback on the progress of individual tasks. It is less structured compared to listr-verbose-renderer but can be used for similar purposes in terms of user feedback.
listr-verbose-renderer
Listr verbose renderer
Install
$ npm install --save listr-verbose-renderer
Usage
const VerboseRenderer = require('listr-verbose-renderer');
const Listr = require('listr');
const list = new Listr([
{
title: 'foo',
task: () => Promise.resolve('bar')
}
], {
renderer: VerboseRenderer
});
list.run();
Note: This renderer supports non-TTY environments.
Options
These options should be provided in the Listr options object.
dateFormat
Type: string
false
Default: HH:mm:ss
Format of the rendered timestamp. Use the date-fns string format. If false
is passed in, the timestamp will be hidden.
Related
License
MIT © Sam Verschueren