Class Task

A Jake Task

event

complete

Index

Constructor methods

Properties

Methods

Constructor methods

constructor(name: string, prereqs?: Array<string>, action?: () => void, opts?: TaskOptions): Task

name

name The name of the Task

Parameters

  • name: string
  • prereqs?: Array<string> optional

    Prerequisites to be run before this task

  • action?: () => void optional

    The action to perform for this task

  • opts?: TaskOptions optional

    Perform this task asynchronously. If you flag a task with this option, you must call the global complete method inside the task's action, for execution to proceed to the next task.

Returns

Task

Properties

public value: any

Methods

public addListener(event: string, listener: Function): EventEmitter

Parameters

  • event: string
  • listener: Function

Returns

EventEmitter

public emit(event: string, args?: Array<any>): boolean

Parameters

  • event: string
  • args?: Array<any> optional

Returns

boolean

public invoke()

Runs prerequisites, then this task. If the task has already been run, will not run the task again.

public listeners(event: string): Array<Function>

Parameters

  • event: string

Returns

Array<Function>

public on(event: string, listener: Function): EventEmitter

Parameters

  • event: string
  • listener: Function

Returns

EventEmitter

public once(event: string, listener: Function): EventEmitter

Parameters

  • event: string
  • listener: Function

Returns

EventEmitter

public reenable()

Runs this task, without running any prerequisites. If the task has already been run, it will still run it again.

public removeAllListeners(event?: string): EventEmitter

Parameters

  • event?: string optional

Returns

EventEmitter

public removeListener(event: string, listener: Function): EventEmitter

Parameters

  • event: string
  • listener: Function

Returns

EventEmitter

public setMaxListeners(n: number)

Parameters

  • n: number