Created
December 13, 2013 02:52
-
-
Save jamlfy/7939182 to your computer and use it in GitHub Desktop.
Exportacion amplia
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
/// Cuando solo carpetas | |
var z = fs.readdirSync(__dirname); | |
for (var i = 0; i < z.length; i++) | |
if( z[i] != 'index.js' ) | |
exports[ z[i] ] = require(path.join( __dirname, z[i] ) ); | |
// Cuando solo archivos | |
var z = fs.readdirSync(__dirname); | |
for ( var i = 0; i < z.length; i++ ) | |
if( z[i] != 'index.js' ) | |
exports[ _.strLeftBack(z[i], '.js') ] = require(path.join( __dirname, z[i] ) ); |
Author
jamlfy
commented
Dec 13, 2013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment