Created
August 14, 2019 07:07
-
-
Save noeljackson/d134452406c1f2d63aa7ee81937edd75 to your computer and use it in GitHub Desktop.
Push out all functions from all files in all directories
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
const req = require.context('.', true, /\.\/[^/]+\/[^/]+\.js$/); | |
req.keys().forEach(key => { | |
Object.keys(req(key)).forEach( component => module.exports[component] = req(key)[component]); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment