# External JS Libraries inside a Node's UI?

**URL:** <https://discourse.nodered.org/t/external-js-libraries-inside-a-nodes-ui/64930>\
**Category:** Developing Nodes\
**Created:** [11 July 2022 08:19 UTC](https://discourse.nodered.org/t/external-js-libraries-inside-a-nodes-ui/64930 "2022-07-11T08:19:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prathamesh\_Gharat](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/prathamesh_gharat/32/46650_2.png) [@Prathamesh\_Gharat](https://discourse.nodered.org/u/Prathamesh_Gharat)\
**Post date:** [11 July 2022 08:19 UTC](https://discourse.nodered.org/t/external-js-libraries-inside-a-nodes-ui/64930/1 "2022-07-11T08:19:26Z")

</div>

Hi,

Is there anything that technically prevents someone from using a custom JS library like [this one](https://querybuilder.js.org/) while building a custom Node's edit interface?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [11 July 2022 08:58 UTC](https://discourse.nodered.org/t/external-js-libraries-inside-a-nodes-ui/64930/2 "2022-07-11T08:58:16Z")

</div>

No, nothing preventing you using jQuery plugins like the query builder one.

You would need to either use a CDN (would require the user to have internet access to configure your nodes settings) OR add the lib as a resource to your node (i.e. present it to the node editor via an admin endpoint)

---

<div class="post-metadata">

**Author:** ![Prathamesh\_Gharat](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/prathamesh_gharat/32/46650_2.png) [@Prathamesh\_Gharat](https://discourse.nodered.org/u/Prathamesh_Gharat)\
**Post date:** [11 July 2022 13:36 UTC](https://discourse.nodered.org/t/external-js-libraries-inside-a-nodes-ui/64930/3 "2022-07-11T13:36:35Z")

</div>

Thanks! I will try the 2nd route to make it self-sufficient without the internet.

P.S. I hope this is the solution you were proposing: [Loading extra resources in the editor : Node-RED](https://nodered.org/docs/creating-nodes/resources)

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [11 July 2022 14:01 UTC](https://discourse.nodered.org/t/external-js-libraries-inside-a-nodes-ui/64930/4 "2022-07-11T14:01:38Z")

</div>

@Prathamesh_Gharat

That is correct.

1. have a folder named `resources` in your modules root directory

2. reference it in your HTML file

I have many files in my resources folder, they can also have sub folders  
﻿`<script type="text/javascript" src="resources/<your-module-name>/more/magic.js"></script>`

---

<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:** [25 July 2022 14:01 UTC](https://discourse.nodered.org/t/external-js-libraries-inside-a-nodes-ui/64930/5 "2022-07-25T14:01:47Z")

</div>

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