Interface Task<O>

interface Task<O> {
    async?: number | boolean;
    dependencies?: TaskDep<any>[];
    desc?: string;
    fn?: ((ctx: TaskContext<O>) => void | Promise<void>);
    force?: boolean;
    loading?: boolean;
    logCommand?: boolean;
    logger?: ILoggerProps;
    name: string;
    namespaces: string[];
    options: O;
    rawArgs: string[];
    resolveOptions?: ((ctx: TaskContext<any>) => O | Promise<O>);
    strict?: boolean;
}

Type Parameters

  • O = any

Hierarchy (view full)

Properties

async?: number | boolean

Dependences are executed serially by default. If order doesn't matter and you want better performance via parallel, you can mark it as asynchronized. Asynchronized will run immediately whether there are synchronized tasks before them or not. You can pass a number as the priority of asynchronized tasks, bigger is formmer.

dependencies?: TaskDep<any>[]
desc?: string
fn?: ((ctx: TaskContext<O>) => void | Promise<void>)
force?: boolean

Whether rerun it when it occured in dependences tree more then once.

loading?: boolean

whether show loading

globalOptions.loading
logCommand?: boolean

whether log executed command

globalOptions.logCommand
logger?: ILoggerProps
name: string
namespaces: string[]
options: O

Parsed options

rawArgs: string[]

Raw arg strings

resolveOptions?: ((ctx: TaskContext<any>) => O | Promise<O>)
strict?: boolean

Whether task options only allow defined options, default false

false