Last active
September 25, 2017 22:37
-
-
Save evantahler/e515a2a5b46c91ffa14831445f615065 to your computer and use it in GitHub Desktop.
modifying requires
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
exports.api = {} | |
exports.initializer = require('./initializer.js') | |
exports.main = require('./main.js') // comment me out and everything is fine |
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 {api} = require('./index.js') | |
exports.initialize = () => { | |
api.initializerStuff = { cool: true } | |
} |
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 {api, initializer} = require('./index.js') | |
api.mainStuff = { | |
cool: true | |
} | |
initializer.initialize() | |
module.exports = () => { | |
console.log({api}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment