Last active
March 13, 2019 08:14
-
-
Save goooooouwa/488fb6a7df0a688f0855cd57112005de to your computer and use it in GitHub Desktop.
nodejs basic module syntax
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
// in module1.js | |
function a(){ | |
console.log('hello'); | |
} | |
module.exports.a = a; | |
// in module2.js | |
const module1 = require('./module1.js'); | |
file1.a(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment