This package has been deprecated

Author message:

Package no longer supported. Contact support@anpmjs.com for more info.

tidying-core

0.2.8 • Public • Published

tidying-core

Travis David npm npm

Architecture

This is still WIP.

  • Plugins are given access to the entirety of the core library and are called at certain callback points.
  • Tasks are the main part of the application and are composed together to create meaningful work. Tasks could come in several logical kinds including control tasks, filters, inputs, outputs, transforms, etc.
  • There are several built-in plugins and tasks, however most are distributed as external modules.

Sample configuration:

export default {
  plugins: [
    new Plugin(),
    new Plugin(),
    new Plugin(),
  ],
  tasks: [
    // There is an implicit ExecuteParallel around the root tasks
    new Task(),
    new Task(),
 
    // Execute tasks in parallel
    new ExecuteParallel(new Task(), new Task()),
    [new Task(), new Task()],
 
    // Execute tasks sequentially (without passing output from one to the next)
    new ExecuteSequential(new Task(), new Task()),
    new Task().then(new Task().then(new Task()))
 
    // Pipe the output of one task into another task
    new ExecutePipe(new Task(), new Task(), new Task()),
    new Task().pipe(new Task().pipe(new Task())),
 
    // Pipe the output of one task into multiple tasks in parallel
    new Task().pipe(new ExecuteParallel(new Task(), new Task())),
    new Task().pipe([new Task(), new Task()]),
    new Task().pipe(new Task(), new Task()),
    new ExecutePipe(new Task(), [new Task(), new Task()]),
 
    // Pipe the output of one task into multiple tasks in sequentially
    new Task().pipe(new ExecuteSequential(new Task(), new Task())),
    new ExecutePipe(new Task(), new ExecuteSequential(new Task(), new Task())),
 
    // Complex shorthand example
    // Task 1 runs, piping output into Task 2, 3, 7, and 10 simultaneously.
    // Task 2 exits when complete
    // Task 3 pipes output to Task 4, which pipes its output into Task 5.
    // Task 5 exits when complete.
    // Task 7 does not pipe its output, but rather starts Task 8 on completion.
    // Task 8 does not pipe its output, but rather starts Task 9 on completion.
    // Task 9 exits when complete.
    // Task 10 does not pipe its output, but rather starts Task 11 and Task 12 simultaneously when complete.
    // Tasks 11 and 12 exit when complete.
    new Task(1).pipe([
      new Task(2),
      new Task(3).pipe(new Task(4), new Task(5)),
      new Task(7).pipe(new ExecuteSequential(new Task(8), new Task(9))),
      new Task(10).pipe(new ExecuteParallel(new Task(11), new Task(12))),
    ]),
  ],
  state: {},
};

Readme

Keywords

none

Package Sidebar

Install

npm i tidying-core

Weekly Downloads

0

Version

0.2.8

License

MIT

Last publish

Collaborators

  • npm