node js jika nama utama

var fnName = function() {
    // main code
}

if (require.main === module) {
    fnName();
}
Famous Flatworm