'use strict'

export function showMe() {
alert("es6");
};

class logging {
constructor() {
alert("es6 class");
}
ha() {
console.log("fff");
}
}

export const log = new logging();



#......
import { showMe, log } from './es6.js';
showMe();
log.ha();

 

 

'use strict'

function showMeC() {
alert("commonjs");
}

module.exports = {
showMeC: showMeC,
};


# ......
const { showMeC } = require('./commonjs.js');

showMeC();

commonjs