Skip to content

Instantly share code, notes, and snippets.

@evantahler
Last active September 25, 2017 22:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evantahler/e515a2a5b46c91ffa14831445f615065 to your computer and use it in GitHub Desktop.
Save evantahler/e515a2a5b46c91ffa14831445f615065 to your computer and use it in GitHub Desktop.
modifying requires
exports.api = {}
exports.initializer = require('./initializer.js')
exports.main = require('./main.js') // comment me out and everything is fine
const {api} = require('./index.js')
exports.initialize = () => {
api.initializerStuff = { cool: true }
}
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