These are chat archives for nodeschool/london

Feb 2015
Simon McManus
Feb 01 2015 08:07
would using Module.export = function(variable) {} in your external file help? Generally the best approach is to use the commonJs exprts object
Anthony Young
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 function. {} ; Exports.two=function{}; if exposing multiple.
Anthony Young
Feb 01 2015 08:53
Thanks again @simonmanus
Oli Evans
Feb 01 2015 09:05
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.