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

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -