Need Help understanding access to nodeJs in Function Item

Hi fellow n8nians!

Can someone point me to some docs or explain what access I have to nodeJS or browser API in a Function Item(s) Node?

Specifically, I was trying to get some things like:

const fs = require('fs')
const path = require('path')
const util = require('util')

and they error out with
ERROR:Access denied to require 'fs'

What are the limitations of a Function Item Node?
Can I access nodeJs in a different way?


You do not have any access to the browser API. You can however use own or built-in Node.js JavaScript libraries if you give access them:

Thanks Jan!

And sorry, I think I knew that from a while back…but forgot.

Follow up, I think I remember some docs about adding your own npm modules to the n8n instance other than those natively included as part of n8n.
Can you point me to that?


Is there a workaround for cloud-hosted N8N? I need to use TextEncoder but can’t require it from the util package.