This is a follow-up question to In Node.js, how do I "include" functions from my other files?
I would like to include an external js file that contains common
You can write all your function declarations first and then export them in an object:
function bar() { //bar } function foo() { //foo } module.exports = { foo: foo, bar: bar };
There's no magical one-liner though, you need to explicitly export the functions you want to be public.