Node : Module
require method
index.js
const helloworld = require('./helloworld.js')
helloworld();
helloworld.js
var helloworld = function() {
console.log('Hello World');
}
module.exports = helloworld;
import method
Newer way of doing it. But most tutorials on the web are not doing it this way.
import http from "http";