Skip to content

Instantly share code, notes, and snippets.

@goooooouwa
Last active March 13, 2019 08:14
Show Gist options
  • Save goooooouwa/488fb6a7df0a688f0855cd57112005de to your computer and use it in GitHub Desktop.
Save goooooouwa/488fb6a7df0a688f0855cd57112005de to your computer and use it in GitHub Desktop.
nodejs basic module syntax
// 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