# Options for simplifying custom node runtime code?

**URL:** <https://discourse.nodered.org/t/options-for-simplifying-custom-node-runtime-code/84576>\
**Category:** Developing Nodes\
**Created:** [13 January 2024 16:51 UTC](https://discourse.nodered.org/t/options-for-simplifying-custom-node-runtime-code/84576 "2024-01-13T16:51:42Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![gregorius](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorius/32/73816_2.png) [@gregorius](https://discourse.nodered.org/u/gregorius)\
**Post date:** [15 January 2024 14:27 UTC](https://discourse.nodered.org/t/options-for-simplifying-custom-node-runtime-code/84576/11 "2024-01-15T14:27:15Z")

</div>

My solution was the development of the [nodedev nodes](https://flows.nodered.org/node/@gregoriusrippenstein/node-red-contrib-nodedev) that generate all the files around a node _in_ Node-RED. Each file is a node in a Node-RED flow - again some meta-programming: a flow that generates flow which generates nodes.

What I end up with is a [flow](https://flowhub.org/f/c620b688530123aa) which in this case contains all the code for the [streaming](https://flows.nodered.org/node/@gregoriusrippenstein/node-red-streaming) package. A second [flow](https://flowhub.org/f/d0506e991d512ace) allows me to publish the package to npmjs and commit to github, all via Node-RED.

Now the advantage is that I don't need to leave Node-RED to extend Node-RED. I don't have worry about remembering all the boilerplate code nor do I have remember the three commands to publish to NPMjs - all that I require is an OTP token.

Disadvantage is that no one understands what I'm doing! But it has sped my development time up enormously and also if I want to update a package, I load the flow from [flowhub.org](http://flowhub.org), make my changes, and publish. There is no need to find a directory on my drive where I put the code, I can update my packages from any Node-RED instance and I have a common development environment for _all_ my packages.

Also if a user can use Node-RED, they can then extend Node-RED _without_ using a third-party editor or setup. After all, commonality amongst all Node-RED users is that they can use Node-RED.

A problem that I haven't solved is the resync from github, i.e., if I change the code at github (for example because of a PR) then I need to update my flow - but I can live with that for now.

Just my 2 cents!

---

_[View the full topic](https://discourse.nodered.org/t/options-for-simplifying-custom-node-runtime-code/84576)._
