Last active
September 6, 2015 16:57
-
-
Save drouillard/5b4583b9b3a5d9a49411 to your computer and use it in GitHub Desktop.
require-directory with rename of dashes/hypens to camelCase
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
'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