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.js
nrg-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 start
and 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