Nodes can be packaged as npm modules. This makes them easy to install along with any dependencies they may have.
Node packages that are maintained by the Node-RED project use the prefix
node-red-node-. 3rd party nodes should chose a naming scheme that avoids that
It is suggested they use
node-red-contrib- as a prefix, although that is not
Here is a typical directory structure for a node package:
- package.json - sample |-sample.html |-sample.js \-icons \-sample.png
There are no strict requirements over the directory structure used within the package. If a package contains multiple nodes, they could all exist in the same directory, or they could each be placed in their own sub-directory.
Along with the usual entries, the
package.json file must contain a
entry that identifies what nodes the module provides, along with a pointer to
If any of the nodes have dependencies on other npm modules, they must be included
To help make the nodes discoverable within the npm repository, the file should
node-red in its
keywords property. This will ensure the package
appears when searching by keyword.
There are lots of guides to publishing a package to the npm repository. A basic overview is available here.
Please be sure to publicise your node on the project mailing list.