# Build nodes using modern javascript with the nrg cli!

**URL:** <https://discourse.nodered.org/t/build-nodes-using-modern-javascript-with-the-nrg-cli/90720>\
**Category:** Developing Nodes\
**Created:** [5 September 2024 03:50 UTC](https://discourse.nodered.org/t/build-nodes-using-modern-javascript-with-the-nrg-cli/90720 "2024-09-05T03:50:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AllanOricil](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/allanoricil/32/106911_2.png) [@AllanOricil](https://discourse.nodered.org/u/AllanOricil)\
**Post date:** [5 September 2024 03:50 UTC](https://discourse.nodered.org/t/build-nodes-using-modern-javascript-with-the-nrg-cli/90720/1 "2024-09-05T03:50:59Z")

</div>

You can now try nrg in this project template!

> **[GitHub - AllanOricil/node-red-node-esm-template: Node-red nodes using ES6+ and esm module system](https://github.com/AllanOricil/node-red-node-esm-template)**
>
> Node-red nodes using ES6+ and esm module system

I would like you to try it out and give feedback!  
Is there a node you can't built with it?

Besides enabling you to write nodes using modern js and in a modular way, it also helps with debugging. The builder creates sourcemaps for both client and server side, and prepare them to appear in the browser as if you were developing frontend components. No more virtual tabs when nodes are loaded!

You can easily debug your client and server side code:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/8/a89670af15989a09a7625b2e1577b79028c0a969.jpeg)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/3/b3f13679bd4c7972c8a951595cf918da2f6765f2.jpeg)

---

<div class="post-metadata">

**Author:** ![AllanOricil](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/allanoricil/32/106911_2.png) [@AllanOricil](https://discourse.nodered.org/u/AllanOricil)\
**Post date:** [5 September 2024 03:51 UTC](https://discourse.nodered.org/t/build-nodes-using-modern-javascript-with-the-nrg-cli/90720/2 "2024-09-05T03:51:40Z")

</div>

You can configure any node-red settings in the `nrg.config.js`. For example

```js
module.exports = {
  version: "0.0.0",
  nodeRed: {
    logging: {
      console: {
        level: "debug",
      },
    },
  },
};

```

These are all the defaults for nrg config: [nrg/defaults/nrg.json at main · AllanOricil/nrg · GitHub](https://github.com/AllanOricil/nrg/blob/main/defaults/nrg.json)

The only dependencies you need in an nrg project are:

`@allanoricil/nrg-cli` and `node-red`

I'm going to make node-red a peer dependency of `@allanoricil/nrg-cli` so that the cli is the only thing you need.

The cli repo can be found here: [GitHub - AllanOricil/nrg-cli: A CLI tool to quickly generate, build, and manage Node-RED nodes and plugins, empowering your development workflow.](https://github.com/AllanOricil/nrg-cli)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [4 November 2024 03:52 UTC](https://discourse.nodered.org/t/build-nodes-using-modern-javascript-with-the-nrg-cli/90720/3 "2024-11-04T03:52:19Z")

</div>

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