# How to change the original code of a Node

**URL:** <https://discourse.nodered.org/t/how-to-change-the-original-code-of-a-node/9977>\
**Category:** General\
**Created:** [10 April 2019 10:21 UTC](https://discourse.nodered.org/t/how-to-change-the-original-code-of-a-node/9977 "2019-04-10T10:21:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikel.garmendia](https://avatars.discourse-cdn.com/v4/letter/m/3ec8ea/32.png) [@mikel.garmendia](https://discourse.nodered.org/u/mikel.garmendia)\
**Post date:** [10 April 2019 10:21 UTC](https://discourse.nodered.org/t/how-to-change-the-original-code-of-a-node/9977/1 "2019-04-10T10:21:28Z")

</div>

Hello!

I am using the node-red-contrib-google-iot-core (version 0.0.4) to connect via MQTT with my Google IoT Broker.

I want to change a little bit the code of this Node. Is that possible?

I want to change the code that it's in the address **/home/pi/.node-red/node\_modules/node-red-contrib-google-iot-core/google-iot-core.js**

In function createJwt I want to change:  
'exp': Math.round(Date.now() / 1000) + 60 \* 60, // 60 minutes  
--\>  
'exp': Math.round(Date.now() / 1000) + 60 \* 60 \* 24, // 24 hours

What steps should I follow to make it work the changes that I have done in google-iot-core.js?

Thank you!

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [10 April 2019 10:32 UTC](https://discourse.nodered.org/t/how-to-change-the-original-code-of-a-node/9977/2 "2019-04-10T10:32:21Z")

</div>

If this is just on your system, just change the code and restart NR

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [10 April 2019 12:04 UTC](https://discourse.nodered.org/t/how-to-change-the-original-code-of-a-node/9977/3 "2019-04-10T12:04:19Z")

</div>

Or you can just raise an issue in that Github [repository](https://github.com/cyberflohr/node-red-contrib-google-iot-core), and ask the author to add an option (to the node's config screen) where you can add the time frequency (minute, hours, …). That way you are sure your changes will never be overwritten accidentally afterwards.  
Bart

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [12 April 2019 15:28 UTC](https://discourse.nodered.org/t/how-to-change-the-original-code-of-a-node/9977/4 "2019-04-12T15:28:06Z")

</div>

Or you can clone the original repository, change your copy and install from that directly.
