node.js - CoffeeScript main? -


i'd have main function run if not imported run , not imported.

is there equivalent python's name == "main" in coffeescript?

right i'm using

is_main = process.argv[1]==__filename if is_main     main() 

but don't know if more idiomatic exists, , noticed did not work older versions of coffeescript.

related js question

main() if require.main module


Comments

Popular posts from this blog

javascript - Iterate over array and calculate average values of array-parts -

ASP.NET Javascript: window.open won't work twice -

jquery - Opera does not change the height of the page. Why? -