# Calling a command line Node.js file

**URL:** https://discourse.nodered.org/t/calling-a-command-line-node-js-file/4437
**Category:** General
**Created:** [31 October 2018 01:15 UTC](https://discourse.nodered.org/t/calling-a-command-line-node-js-file/4437 "2018-10-31T01:15:26Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![jewendt](https://avatars.discourse-cdn.com/v4/letter/j/3ab097/32.png) [@jewendt](https://discourse.nodered.org/u/jewendt)
#### Post date: [31 October 2018 01:15 UTC](https://discourse.nodered.org/t/calling-a-command-line-node-js-file/4437/1 "2018-10-31T01:15:26Z")

</div>

I found some example Node.js applications that I would like to use within node red. I was successful at using the Exec node and called it via the a command like this "node "c:\testjs\test.js"" I keep thinking that there is a better way to execute the node javascript more directly. Is there some obvious way I am missing?

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [31 October 2018 07:11 UTC](https://discourse.nodered.org/t/calling-a-command-line-node-js-file/4437/2 "2018-10-31T07:11:23Z")

</div>

Depends what you mean by inside Node-RED. If you want to keep them as files then exec is fine. Or you could paste the contents of the file into a function node and then have to fix it up to accept msg. as the input parameters etc, which is probably more work.
