# Using 'fs' in the node function

**URL:** <https://discourse.nodered.org/t/using-fs-in-the-node-function/9460>\
**Category:** General\
**Created:** [26 March 2019 15:58 UTC](https://discourse.nodered.org/t/using-fs-in-the-node-function/9460 "2019-03-26T15:58:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lkaiser](https://avatars.discourse-cdn.com/v4/letter/l/a587f6/32.png) [@lkaiser](https://discourse.nodered.org/u/lkaiser)\
**Post date:** [26 March 2019 15:58 UTC](https://discourse.nodered.org/t/using-fs-in-the-node-function/9460/1 "2019-03-26T15:58:55Z")

</div>

Hi everyone,

I just discover Node-red and I want to use the node "function" to manipulate files and folders with fs object.

I Uncomment this line in the settings.js

> //var fs = require("fs");

and try to use

> var fs = global.get('fs');

but the variable fs is set to _undefined_ 😟

Could You help me please, thank You

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [26 March 2019 16:09 UTC](https://discourse.nodered.org/t/using-fs-in-the-node-function/9460/2 "2019-03-26T16:09:59Z")

</div>

Hi @lkaiser

this page of the docs explains how to add additional modules to the Function node - [https://nodered.org/docs/writing-functions#loading-additional-modules](https://nodered.org/docs/writing-functions#loading-additional-modules)

In short, you have to add them to the `functionGlobalContext` property in your settings file.

---

<div class="post-metadata">

**Author:** ![lkaiser](https://avatars.discourse-cdn.com/v4/letter/l/a587f6/32.png) [@lkaiser](https://discourse.nodered.org/u/lkaiser)\
**Post date:** [26 March 2019 16:22 UTC](https://discourse.nodered.org/t/using-fs-in-the-node-function/9460/3 "2019-03-26T16:22:40Z")

</div>

Thank You very much knolleary !

it works very well.  
I did not read correctly this section of the docs 🙄
