How to version input/output?

As the input and output of a custom node might change over time, I'm wondering what would be best practice for keeping track of this... shall I simply rely on the version of a node (e.g. another node could read the version of my node to figure out what the current API is...)?

Generally, nodes should be loosely coupled. A custom node should specify what data is expects as input and what it produces as output. It is up to flow designers to slot the nodes together appropriately.

It is best if your node is fairly flexible and it should be good at identifying incorrect data and spitting out a suitable warning or error message. Obviously, a custom node that crashes node-red due to an unhandled exception is very bad practice indeed.

Following semantic versioning practices for nodes is the best idea. That way, people will know if there are potentially breaking changes and npm and the package.json file largely keeps things compatible if doing scripted/automated updates (the Node-RED palette manager always installs the latest version, it ignores the version specification in package.json I believe).

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.