Using the Flusspferd shell / interpreter

Once Flusspferd is installed, you can run flusspferd like this:

$ flusspferd

It will open up a shell. You can use it to evaluate arbitrary Javascript expressions.

> 1 + 1
2
> world = "Shell"; print("Hello", world);
Hello Shell

You can also invoke flusspferd to run a Javascript file:

$ flusspferd source.js

For more options, run flusspferd -h.

Command line arguments

Arguments given on the command line after the script name are available as a normal JavaScript array on the system module called args. For example:

#!/usr/bin/env flusspferd
function print_args(args) {
  // args.length is equivalent to argc in c
  print("There are", args.length, "argument(s)");

  for (var i=0; i<args.length; i++) {
    print(args[i]);
  }
}
var system = require('system');
print_args(system.args);

Using inferior-flusspferd-mode

Flusspferd comes with an Emacs mode. The Flusspferd mode can be used to interactively develop javascript code by sending it to the Flusspferd shell.

See Emacs Mode install instructions on how to use it.

Next: Using io


Contact us at team -AT- flusspferd -DOT- org or as described on our homepage.

Generated on Thu Feb 4 23:05:12 2010 for Flusspferd by doxygen 1.6.1