Start with your module, utils.coffee:
exports.foo = -> exports.bar = ->
Then your main file:
utils = require './utils' utils.foo()
foo () and bar () are functions that you often call, so you:
foo = require('./utils').foo bar = require('./utils').bar foo()
This approach works when only a few functions are defined in a module, but becomes erratic as the number of functions increases. Is there a way to add all the module functions to the application namespace?
knite source share