This project illustrates the utilization of the nrg CLI for the development of Node-RED nodes.
This project is built using the nrg cli.
nrg-template/
āāā src/
āāā nodes/
āāā node-1/
ā āāā client/
ā ā āāā locales/
ā ā ā āāā labels/
ā ā ā ā āāā de.json
ā ā ā ā āāā en-US.json
ā ā ā āāā docs/
ā ā ā āāā de.html
ā ā ā āāā en-US.html
ā ā āāā icons/
ā ā ā āāā icon-1.png
ā ā āāā index.html
ā ā āāā index.js
ā āāā server/
ā āāā index.js
āāā node-2/
āāā client/
ā āāā locales/
ā ā āāā labels/
ā ā ā āāā de.json
ā ā ā āāā en-US.json
ā ā āāā docs/
ā ā āāā de.html
ā ā āāā en-US.html
ā āāā icons/
ā ā āāā icon-2.png
ā āāā index.html
ā āāā index.js
āāā server/
āāā index.jsnrg-template/
āāā dist/
āāā icons/
ā āāā icon-1.png
ā āāā icon-2.png
āāā locales/
ā āāā de/
ā ā āāā index.html
ā ā āāā index.json
ā āāā en-US/
ā āāā index.html
ā āāā index.json
āāā index.html
āāā index.js.map
āāā index.js| Tool | Version |
|---|---|
| node | >= 18 |
| npm | >= 10 |
- open a terminal in the root of this project
- run
npm install - run
npm run startand wait for your browser to open.
All the following commands are set in the scripts section of package.json and were created using the nrg CLI.
Builds the project for production.
Builds the project for development.
Starts Node-RED with nodes built for development.
Starts Node-RED with nodes built for production.
Starts Node-RED with nodes built for development and enables debug mode, allowing you to attach a debugger to the server side.
Starts Node-RED with nodes built for development and enables watch mode. This will automatically rebuild your nodes, restart the flows, and refresh/open the browser whenever changes are made to files in ./src.
Starts Node-RED with nodes built for development in both watch and debug modes. This setup allows you to automatically rebuild, restart, and debug the server side with the ability to attach a debugger.
If you have the nrg CLI installed globaly, you can create a new node with the following commnad:
nrg create node -n my-node-name
or, if you have it installed as a dev dependency, you can use:
./node_modules/.bin/nrg create node -n my-node-name
If you have the nrg CLI installed globally, you can run the following commands to get started:
nrg create -n my-nrg-project cd my-nrg-project npm install # pnpm install # yarn install