UNPKG

1.58 kBMarkdownView Raw
1# listr-update-renderer [![Build Status](https://travis-ci.org/SamVerschueren/listr-update-renderer.svg?branch=master)](https://travis-ci.org/SamVerschueren/listr-update-renderer)
2
3> [Listr](https://github.com/SamVerschueren/listr) update renderer
4
5<img src="screenshot.gif" />
6
7
8## Install
9
10```
11$ npm install --save listr-update-renderer
12```
13
14
15## Usage
16
17```js
18const UpdaterRenderer = require('listr-update-renderer');
19const Listr = require('listr');
20
21const list = new Listr([
22 {
23 title: 'foo',
24 task: () => Promise.resolve('bar')
25 }
26], {
27 renderer: UpdaterRenderer,
28 collapse: false
29});
30
31list.run();
32```
33
34> Note: This is the default renderer for [Listr](https://github.com/SamVerschueren/listr) and doesn't need to be specified.
35
36
37## Options
38
39These options should be provided in the [Listr](https://github.com/SamVerschueren/listr) options object.
40
41### showSubtasks
42
43Type: `boolean`<br>
44Default: `true`
45
46Set to `false` if you want to disable the rendering of the subtasks. Subtasks will be rendered if an error occurred in one of them.
47
48### collapse
49
50Type: `boolean`<br>
51Default: `true`
52
53Set to `false` if you don't want subtasks to be hidden after the main task succeed.
54
55
56## Related
57
58- [listr](https://github.com/SamVerschueren/listr) - Terminal task list
59- [listr-verbose-renderer](https://github.com/SamVerschueren/listr-verbose-renderer) - Listr verbose renderer
60- [listr-silent-renderer](https://github.com/SamVerschueren/listr-silent-renderer) - Suppress Listr rendering output
61
62
63## License
64
65MIT © [Sam Verschueren](https://github.com/SamVerschueren)