Node-RED 2.0 frees itself from Node.js of old, gets flow debugger and linter

Node-RED 2.0 frees itself from Node.js of old, gets flow debugger and linter

Visual low-code programming tool for event-driven applications Node-RED has made the jump to version 2.0, getting a bit lighter in the process. 

Node-RED is built on Node.js and was developed as an easy way to combine hardware devices like the Raspberry Pi or Arduino, cloud services, and various APIs into applications for the Internet of Things. This was about eight years ago, with the tool becoming one of the founding projects of the JS Foundation (now OpenJS Foundation) in the meantime.

For its second major release, the Node-RED team decided to drop Node.js versions that are no longer supported, in order to make some internal dependency updates. Figuring these out took a little longer than anticipated, which is why the release didn’t land at it’s usual time in April. With that out of the way, however, the team can get back to concentrating on features and refine a few of the new tools that made it into the release. 

Users will have to have Node.js 12.17.x or later installed to use Node-RED 2.0, which comes with new runtime features such as the node-red admin init command. Once run, the tool will ask a couple of questions regarding user security, project workflows, editor and node settings, and turn those into a fully fledged settings file — which can be especially useful for those new to Node-RED.

Those already familiar with settings files should give the new default a quick look, since the team reorganised the settings for better clarity, and comes with the standard flow file name hardcoded so that there are less issues when switching between networks. Developers can also opt into using Monaco, the text editor behind VS Code, instead of the regular ACE — just set the editorTheme section inside the settings file accordingly.

Speaking of getting hands-on with coding, Node-RED 2.0 also offers two new plugins for more inside when building applications: Flow Debugger and Flow Linter. Just like regular code debuggers, the Flow Debugger is meant to let you set breakpoints, which can be used to pause the program flow and show how many messages are queued at each point and in which order they will be processed. 

Meanwhile linter nrlint can either be used outside the editor to validate flows in build pipelines or within it to spot potential flow problems by checking if the flow in question adheres to certain rules. Currently there aren’t that many rules yet, but the linter has been designed for easy extensibility, meaning that linter rules are pluggable.

Developers who need the tail node for their projects should be aware that this has been removed as a default dependency in the new release and might have to be added back manually. Another change worth noting is that the report by exception (RBE) node is now called Filter and has become part of the core palette. This shouldn’t affect existing flows but could be good to know as the Node-RED team might add more filtering options under the new name.

With this release out of the way, the Node-RED team plans to get back to its usual quarterly release cadence. So version 2.1 should be ready by the end of October.