noflo

Flow-based programming for JavaScript

Github星跟踪图

NoFlo: Flow-based programming for JavaScript Build Status Build status Coverage Status

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:

  • Flowhub -- browser-based visual programming IDE for NoFlo and other flow-based systems
  • noflo-nodejs -- command-line interface for running NoFlo programs on Node.js
  • MsgFlo -- for running NoFlo and other FBP runtimes as a distributed system
  • 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.

Support

Flowhub logo

NoFlo is a part of Flowhub, a platform for building robust IoT systems and web services.
We offer an Integrated Development Environment and consulting services.

By subscribing to Flowhub you directly support NoFlo development, and help us all get to the future of programming faster.

Requirements and installing

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

$ npm install noflo --save

You can make a browser build of NoFlo using webpack. For webpack builds, you need configure the component loader statically with noflo-component-loader. For projects using Grunt, grunt-noflo-browser plugin makes this easy.

Installing from Git

NoFlo requires a reasonably recent version of Node.js, and some npm packages. Ensure that you have NoFlo checked out from Git, and all NPM dependencies installed. Build NoFlo with:

$ npm run build

Then you can install everything needed by a simple:

$ npm link

NoFlo is available from GitHub under the MIT license.

Changes

Please refer to the Release Notes and the CHANGES.md document.

Usage

Please refer to http://noflojs.org/documentation/. For visual programming with NoFlo, see https://docs.flowhub.io/.

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 are run for both Node.js and the browser. You can also run only the tests for a particular target platform:

$ grunt test:nodejs

or:

$ grunt test:browser

Running tests automatically

The build system used for NoFlo is also able to watch for changes in the filesystem and run the tests automatically when something changes. To start the watcher, run:

$ grunt watch

If you want to only run a particular part of the test suite, you can filter them using the TESTS environment variable:

$ TESTS="Network Lifecycle" grunt watch

To quit the watcher, just end the process with Ctrl-C.

Discussion

There is an IRC channel #fbp on FreeNode, and questions can be posted with the noflo tag on Stack Overflow. See http://noflojs.org/support/ for other ways to get in touch.

主要指标

概览
名称与所有者noflo/noflo
主编程语言JavaScript
编程语言JavaScript (语言数: 1)
平台
许可证MIT License
所有者活动
创建于2011-06-06 04:33:02
推送于2024-04-07 11:04:18
最后一次提交2024-04-07 13:04:18
发布数80
最新版本名称1.4.3 (发布于 )
第一版名称0.0.2 (发布于 )
用户参与
星数3.5k
关注者数133
派生数267
提交数2.7k
已启用问题?
问题数292
打开的问题数32
拉请求数347
打开的拉请求数10
关闭的拉请求数401
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?