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.
main() if require.main module
Comments
Post a Comment