This package has been deprecated

Author message:

this package has been deprecated

@swwind/tasker
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Tasker

A lightweight task runner for nodejs command line tools.

轻量级的 nodejs 命令行任务运行工具。

const tasker = require('@swwind/tasker');

const sleep = (time) => () => new Promise((resolve) => { setTimeout(resolve, time) });

tasker.run([

  tasker.confirm('Process with test?', true),

  tasker.task('My name is Van', [
    tasker.task('I\'m artist.', sleep(500)),
    tasker.task('I\'m a performance artist.', sleep(500)),
    tasker.task('I\'m hired for people to fulfill their fantasies.', sleep(1000)),
    tasker.task('Their Deep♂Dark♂Fantasies.', sleep(500)),
  ]),

  tasker.confirm('Do you like fantasies?', true, [
    tasker.task('Hey buddy, I think you have got the wrong door.', sleep(1000)),
    tasker.task('The leather club is two blocks down.', sleep(1000)),
    tasker.confirm('Do you like to create a file?', false, [
      tasker.exec('I\'m gonna create a file', 'touch', ['testfile']),
      tasker.exec('Now I\'ll remove it', 'rm', ['testfile']),
    ]),
  ]),

]);

Output:

:: Process with test? [Y/n]
:: My name is Van
(1/4) I'm artist.
(2/4) I'm a performance artist.
(3/4) I'm hired for people to fulfill their fantasies.
(4/4) Their Deep♂Dark♂Fantasies.
:: Do you like fantasies? [Y/n]
(1/3) Hey buddy, I think you have got the wrong door.
(2/3) The leather club is two blocks down.
(3/3) Do you like to create a file? [y/N] y
==> I'm gonna create a file
 $ touch testfile
==> Now I'll remove it
 $ rm testfile

Readme

Keywords

none

Package Sidebar

Install

npm i @swwind/tasker

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

5.82 kB

Total Files

6

Last publish

Collaborators

  • swwind233