Printing out Spark events with JS

Some of this might be useful:

This contains a fairly trivial example as well: