0.2.1 • Published 9 months ago

@pocketflow/viz v0.2.1

Weekly downloads
-
License
-
Repository
-
Last release
9 months ago

PocketFlow.js Viz

Helper for @pocketflow/core to visualize the workflow.

Installation

npm install @pocketflow/viz

Usage

import { visualize } from '@pocketflow/viz';
import { Flow, Node } from '@pocketflow/core';

class Node1 extends Node {
  async exec(shared: any): Promise<any> {
    return shared;
  }
}

class Node2 extends Node {
  async exec(shared: any): Promise<any> {
    return shared;
  }
}

const node1 = new Node1();
const node2 = new Node2();
node1.connect(node2);

(async () => {
  await visualize(new Flow(node1));
})();

For the example below, refer to the code from essay.ts.

Flow visualization

0.2.1

9 months ago