What is listr-silent-renderer?
The listr-silent-renderer npm package is a utility renderer for the Listr task runner, which is designed to suppress the output of tasks. This is particularly useful in scenarios where you want to run tasks silently without cluttering the console with logs, unless an error occurs.
Silent Task Execution
This feature allows tasks to be executed silently. The code sample demonstrates how to set up a Listr task list with the SilentRenderer, which will not output any logs unless an error occurs.
const Listr = require('listr');
const SilentRenderer = require('listr-silent-renderer');
const tasks = new Listr([
{
title: 'Silent task',
task: () => Promise.resolve('Task completed silently')
}
], { renderer: SilentRenderer });
tasks.run().catch(err => console.error(err));