Skip to content

Repository files navigation

Dflow

A minimal Dataflow programming engine

See:

Usage

Let's start with an "Hello World!".

Define a single DflowNode that outputs to the console and create a dflow instance that runs it.

import{Dflow,typeDflowNode}from"dflow";// Define a node.consthelloWorld: DflowNode={kind: "hello",run: ()=>console.log("Hello, World!")};constnodeDefinitions=[helloWorld];// Create a dflow instance.constdflow=newDflow(nodeDefinitions);// Add a node to the graph.dflow.node("hello");// Run the dflow graph.dflow.run();

Important

The recommended way to run a graph is with await, wrapped in a try/catch block.

try{awaitdflow.run();}catch(error){// Here `error` should be an instance of `AggregateError`.}

More examples available in the documentation, see the "Usage" section.

License

MIT

About

A minimal Dataflow programming engine

Topics

Resources

Stars

77 stars

Watchers

6 watching

Forks

Used by

Contributors

Languages