神刀安全网

[工具资源] 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

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » [工具资源] listr – Terminal Task List

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址