header banner
Default

With its new flow debugger and flow linter, Node-RED 20 enhances the developer experience


Table of Contents

    IoT-focused low-code programming tool Node-RED reaches version 2.0, bringing flow debugger and flow linter to help programmers find bugs in their flows.

    Node-RED 2.0 has mostly focused on removing support for older versions of Node.js and update a number of internal dependencies. Still, the new flow debugger and flow linter, both available as plugins, will be a welcome addition to most developers.

    Node-RED flow debugger allows you to set breakpoints on node ports, so your flow will stop each time a new message is received on that port. This makes it possible to inspect all the messages that are queued and waiting to be processed. You can also execute the flow one message at a time, or delete a queued message. This possibility is especially relevant since Node-RED went async a couple of years ago, thus making the relative order of message handling less intuitive.

    At the moment, the flow debugger does not support conditional breakpoints nor editing queued messages, but both features are in the works. Likewise, it is not currently possible to pause only a subset of nodes, but it will be in a future release.

    Node-RED flow linter, called nrlint can be used to identify potential problems in a flow. nrlint uses a set of rule to identify potentially incorrect uses, such as leaving the output of an HTTP In node not connected to any HTTP Response nodes. nrlint can also be integrated with eslint, which can be useful in case your flow includes custom JavaScript code.

    The Node-RED linter uses a browser Worker thread and provides its results in a separate sidebar, allowing you also to quickly navigate to the areas of your flow that need attention. nrliter can be alternatively run from the command line to integrate the linting step in a CI pipeline.

    Still on the developer experience front, Node-RED 2.0 replaces its code editor ACE with Monaco. Monaco is the editor engine that powers Microsoft Visual Studio Code and will make all Visual Studio Code developers feel at home in Node-RED 2.0. Monaco is enabld by default, but user can switch back to ACE it they require so.

    Other notable improvements to Node-RED 2.0 include a new node-red admin init command to easily create a correctly configured settings file; improved support for calling external modules from Function nodes; the Report By Exception (RBE) node, used to discard messages when their data has not changed, is now part of the default palette and has been more meaningfully renamed to Filter; and more.

    Sources


    Article information

    Author: Joshua Melendez

    Last Updated: 1704120482

    Views: 1169

    Rating: 4.6 / 5 (104 voted)

    Reviews: 90% of readers found this page helpful

    Author information

    Name: Joshua Melendez

    Birthday: 1966-04-18

    Address: Unit 8587 Box 7725, DPO AE 60495

    Phone: +3780005650288615

    Job: Taxi Driver

    Hobby: Soccer, Running, Sewing, Quilting, Lock Picking, Amateur Radio, Surfing

    Introduction: My name is Joshua Melendez, I am a Colorful, Adventurous, candid, multicolored, valuable, dedicated, ingenious person who loves writing and wants to share my knowledge and understanding with you.