Created
December 30, 2014 21:10
-
-
Save amboy00/a215c915ed1f47ec71af to your computer and use it in GitHub Desktop.
There has to be a better way to load these files. Also, that . path and relative path stuff…
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
// load all files in models dir | |
fs.readdirSync( './models/' ).forEach( function( filename ) { | |
if ( ~filename.indexOf('.js')) { | |
require( '../models/' + filename); | |
} | |
console.log(filename); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment