customevents.coffee 274 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 casper = require('casper').create() # listening to a custom event casper.on 'google.loaded', (title) -> casper.echo "Google page title is #{title}" casper.start 'http://google.com/', -> # emitting a custom event @emit 'google.loaded', @getTitle() casper.run()