Last active
December 5, 2017 16:24
-
-
Save kamleshchandnani/2ce9ed44e9e03401718cc260883e690a to your computer and use it in GitHub Desktop.
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
// File log.js | |
function log(){ | |
console.log('Example of CJS module system'); | |
} | |
// expose log to other modules | |
module.exports = { log } | |
// File index.js | |
var logModule = require('./log'); | |
logModule.log(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment