Last active
January 8, 2017 07:28
-
-
Save fguisso/45905b4e1aea1f8268b2391038aaa6c3 to your computer and use it in GitHub Desktop.
import all modules in this dir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Call and export all models | |
fs.readdirSync('model').forEach(file => { | |
if (file !== 'db.connection.js') { | |
const moduleName = file.split('.')[0]; | |
exports[moduleName] = require(`model/${file}`); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment