← Previous
Next →

Javascript Shebangs

John Tantalo
20 Dec 2010

Ringo, Narwhal, Node, and JavaScriptCore support executing scripts with a shebang).

Here are some quick examples to get you started.

Ringo

#!/usr/bin/env ringo
print("ringo");

Narwhal

#!/usr/bin/env narwhal
print("narwhal");

Node

#!/usr/bin/env node
require("sys").print("node\n");

JavaScriptCore

#!/usr/bin/env jsc
print("jsc");

JavaScriptCore nightly added support for shebangs on 6 December 2010.

Since Node and JavaScriptCore are binaries, you can use the full path instead of env.