These are chat archives for nodeschool/london

1st
Feb 2015
Simon McManus
@simonmcmanus
Feb 01 2015 08:07
Module.ex
would using Module.export = function(variable) {} in your external file help? Generally the best approach is to use the commonJs exprts object
Anthony Young
@ayoungh
Feb 01 2015 08:15
Thanks @simoncmanus, I've done this now, is it ok to ..export = function
Does this not overwrite it
So in my app.js I have required a routes file
In this I am doing export = function and passing in some params from my app.js
I use Module.exports if i want to expose one function and exports.one= function. {} ; Exports.two=function{}; if exposing multiple.
Anthony Young
@ayoungh
Feb 01 2015 08:53
Thanks again @simonmanus
Oli Evans
@olizilla
Feb 01 2015 09:05
+1
Also consider pulling global configuration out into a seperarte config file. You can use a simple json file and require it where needed, or modules like config for fancy, environment specific configuration handling.