Auto require a directory in Node.js
results = []
require("fs").readdirSync(__dirname).forEach (file) ->
results.push require("#{__dirname}/#{file}") unless file is "index.coffee"
module.exports = results
Written by Christopher Garvis
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Nodejs
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#