Mercurial > psgxs
view modules.js @ 37:45d0cd9388ea
Fix mod_retrieve.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Wed, 10 Nov 2010 18:31:02 +0100 |
parents | b2faacfefb90 |
children | bc717575e66a |
line wrap: on
line source
var modules = exports; var files = require('fs').readdirSync('modules'); var regex = /^mod_.*\.js/; for (var i in files) { var file = files[i]; if (!regex.test(file)) continue; var module = require('./modules/' + files[i]); for (var j in module) { if (typeof modules[j] != 'undefined') console.log('WARNING: module '+j+' already loaded.'); modules[j] = module[j]; } }