Knoten JS, wenn namens Hauptname

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

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