Skip to content

Instantly share code, notes, and snippets.

@jamlfy
Created December 13, 2013 02:52
Show Gist options
  • Save jamlfy/7939182 to your computer and use it in GitHub Desktop.
Save jamlfy/7939182 to your computer and use it in GitHub Desktop.
Exportacion amplia
/// 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] ) );
@jamlfy
Copy link
Author

jamlfy commented Dec 13, 2013

var fs = require('fs');
``
https://github.com/epeli/underscore.string

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment