Skip to content

Instantly share code, notes, and snippets.

@amboy00
Created December 30, 2014 21:10
Show Gist options
  • Save amboy00/a215c915ed1f47ec71af to your computer and use it in GitHub Desktop.
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…
// 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