8000 noflo/packages/noflo at master · noflo/noflo · GitHub
[go: up one dir, main page]

Skip to content

Latest commit 8000

 

History

History

noflo

README.md

NoFlo: Flow-based programming for JavaScript

NoFlo is an implementation of flow-based programming for JavaScript running on both Node.js and the browser. From WikiPedia:

In computer science, flow-based programming (FBP) is a programming paradigm that defines applications as networks of "black box" processes, which exchange data across predefined connections by message passing, where the connections are specified externally to the processes. These black box processes can be reconnected endlessly to form different applications without having to be changed internally. FBP is thus naturally component-oriented.

Developers used to the Unix philosophy should be immediately familiar with FBP:

This is the Unix philosophy: Write programs that do one thing and do it well. Write programs to work together. Write programs to handle text streams, because that is a universal interface.

It also fits well in Alan Kay's original idea of object-oriented programming:

I thought of objects being like biological cells and/or individual computers on a network, only able to communicate with messages (so messaging came at the very beginning -- it took a while to see how to do messaging in a programming language efficiently enough to be useful).

NoFlo components can be written in any language that transpiles down to JavaScript, including ES6. The system is heavily inspired by J. Paul Morrison's book Flow-Based Programming.

Read more at https://noflojs.org/.

Suitability

NoFlo is not a web framework or a UI toolkit. It is a way to coordinate and reorganize data flow in any JavaScript application. As such, it can be used for whatever purpose JavaScript can be used for. We know of NoFlo being used for anything from building web servers and build tools, to coordinating events inside GUI applications, driving robots, or building Internet-connected art installations.

Tools and ecosystem

NoFlo itself is just a library for implementing flow-based programs in JavaScript. There is an ecosystem of tools around NoFlo and the fbp protocol that make it more powerful. Here are some of them:

  • NoFlo Development Environment -- browser-based visual programming IDE for NoFlo and other flow-based systems
  • noflo-nodejs -- command-line interface for running NoFlo programs on Node.js
  • noflo-browser-app -- template for building NoFlo programs for the web
  • @noflo/assembly -- industrial approach for designing NoFlo programs
  • fbp-spec -- data-driven tests for NoFlo and other FBP environments
  • flowtrace -- tool for retroactive debugging of NoFlo programs. Supports visual replay with Flowhub

See also the list of reusable NoFlo modules on NPM.

Requirements and installing

NoFlo is available for Node.js via NPM, so you can install it with:

$ npm install @noflo/noflo --save

NoFlo 2.x requires Node.js 22 or later. It runs in the browser as plain ES modules with no build step: applications supply their components through a component registry — a static registry literal, or discovery on Node.js. See component loading for the patterns.

Installing from Git

NoFlo is developed as an npm-workspaces monorepo. Check it out from Git and install the workspace dependencies:

$ npm install

There is no build step — the packages ship plain ES modules. When working against the checkout, generate the TypeScript definitions once so type checks resolve:

$ npm run types --workspaces

NoFlo is available from GitHub under the MIT license.

Changes

Please refer to the CHANGELOG.md

Usage

Please refer to http://noflojs.org/documentation/.

Development

NoFlo development happens on GitHub. Just fork the main repository, make modifications and send a pull request.

We have an extensive suite of tests available for NoFlo. Run them with:

$ npm test

Platform-specific tests

By default, the tests run on Node.js. The suite is also run on Deno and Bun:

$ npm run test:deno

or:

$ npm run test:bun

Browser verification is a Playwright suite at the monorepo root; it always runs in CI and is opt-in locally:

$ npm run test:browser

Discussion

There is a #noflo channel on the Flow-Based Programming Slack, and questions can be posted with the noflo tag on Stack Overflow. See http://noflojs.org/support/ for other ways to get in touch.

0