Skip to content

Instantly share code, notes, and snippets.

@rasolofonirina
Last active March 25, 2022 12:41
Show Gist options
  • Save rasolofonirina/54fa43764f186499c9538a1c614dc024 to your computer and use it in GitHub Desktop.
Save rasolofonirina/54fa43764f186499c9538a1c614dc024 to your computer and use it in GitHub Desktop.
Export Node.js
// Create a folder mymodule and put this in file named mymodule.js
const kaizKaiz = () => {
console.log('Kaiza kaiza daholo e !')
}
const surSur = function() {
console.log('Sur sur e !')
}
exports.kaizKaiz = kaizKaiz
exports.surSur = surSur
// Put this code on the file when you want to use them
const mymodule = require('./mymodule')
mymodule.kaizKaiz()
mymodule.surSur()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment