转载

[工具资源] listr - Terminal Task List

listr

Terminal task list

[工具资源] listr - Terminal Task List

Install

$ npm install --save listr 

Usage

const execa = require('execa'); const Listr = require('listr');  const tasks = new Listr([     {         message: 'Install package dependencies',         task: () => execa('npm', ['install'])     },     {         message: 'Run tests',         task: () => execa('npm', ['test'])     },     {         message: 'Publish package',         task: () => execa('npm', ['publish'])     } ]);  tasks.run().catch(err => {     console.error(err); });

API

Listr([tasks])

tasks

Type: object[]

List of tasks.

message

Type: string

Message of the task.

task

Type: Function

Task function.

Instance

addTask(task)

task

Type: object[]

Task object.

run()

Start executing the tasks.

Related

  • ora - Elegant terminal spinner
  • cli-spinners - Spinners for use in the terminal

License

MIT ©Sam Verschueren

原文  https://github.com/SamVerschueren/listr
正文到此结束
Loading...