# The RED object has 3 APIs

**URL:** <https://discourse.nodered.org/t/the-red-object-has-3-apis/90760>\
**Category:** General\
**Created:** [6 September 2024 19:44 UTC](https://discourse.nodered.org/t/the-red-object-has-3-apis/90760 "2024-09-06T19:44:56Z")\
**Posts on this page:** 2\
**Page:** 1

<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:** [6 September 2024 19:44 UTC](https://discourse.nodered.org/t/the-red-object-has-3-apis/90760/1 "2024-09-06T19:44:56Z")

</div>

Hi There,

I have a question related to the RED object that exists in three different incarnations:

- RED in the backend
- RED in the context of a function node
- RED in the frontend browser console

each of these RED objects has a different API, eg: `RED.nodes.node(<nodeid>)` will return the node object in the frontend, `RED.nodes.getNode(<nodeid>)` will do the same thing in the backend and in a function node this isn't possible:

```auto
msg.node = RED.nodes.getNode("nodeid")

```

results in

```auto
"TypeError: Cannot read properties of undefined (reading 'getNode')"

```

when done in a function node.

What this means is that in a custom node, I can use the `RED.nodes.getNode(<nodeid>)` to get a node, in the function node I can't but how do I know?

So here my question: is there a way to start the Node-RED backend in a console mode where I can start the backend in the context of a flows.json and then start play around. Something like:

```auto
shell-prompt> node-red --debug-console
Welcome to Node.js v21.6.1.
Type ".help" for more information.
Node-RED v3.1.1 loaded
/user/fubar/.node-red/flows.json loaded
> console.log(RED)
....

```

This would make testing custom nodes a little simpler.

Sorry if this has already been answered ...

---

<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:** [5 December 2024 19:45 UTC](https://discourse.nodered.org/t/the-red-object-has-3-apis/90760/2 "2024-12-05T19:45:09Z")

</div>

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