Skip to content

Instantly share code, notes, and snippets.

@drouillard
Last active September 6, 2015 16:57
Show Gist options
  • Save drouillard/5b4583b9b3a5d9a49411 to your computer and use it in GitHub Desktop.
Save drouillard/5b4583b9b3a5d9a49411 to your computer and use it in GitHub Desktop.
require-directory with rename of dashes/hypens to camelCase
'use strict';
var requireDirectory = require('require-directory');
var renamer = function (name) {
return name.replace(/-([a-z])/g, function (m, c) {
return c.toUpperCase();
});
};
module.exports = requireDirectory(module, {rename: renamer});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment