@iamyth/task-runner
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Task Runner

Description

A simple utility class for writing your (async) tasks, and it will be executed sequentially.

Installation

> npm install -DE @iamyth/task-runner
# or
> yarn add -DE @iamyth/task-runner

Example

// build.ts

import { TaskRunner } from '@iamyth/task-runner';

new TaskRunner('My Awesome Task').execute([
    {
        name: 'Prettier',
        execute: () => {
            // Prettier Checking
        },
        skipInFastMode: true, // This Task will not be ran in fast mode
    },
    {
        name: 'Prepare Folder',
        execute: () => {
            fs.mkdirSync('my-dest-folder');
        },
    },
    {
        name: 'tsc',
        execute: () => {
            child_process.spawnSync('tsc', ...rest);
        },
    },
]);
ts-node --project tsconfig.json build.ts
# or Run in fast mode
ts-node --project tsconfig.json build.ts --mode fast

Readme

Keywords

none

Package Sidebar

Install

npm i @iamyth/task-runner

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

10.8 kB

Total Files

8

Last publish

Collaborators

  • jamyth