 {spawn, exec}  = require 'child_process'
 {EventEmitter} = require 'events'
 
+# Allow CoffeeScript to emit Node.js events, and add it to global scope.
 helpers.extend CoffeeScript, new EventEmitter
+global.CoffeeScript = CoffeeScript
 
 # The help banner that is printed when `coffee` is called without arguments.
 BANNER = '''

  o = options
  codeOpts = compileOptions source
  if o.require
    require file for file in o.require
  try
    CoffeeScript.emit 'compile', {source, code, base, options}
    if      o.tokens      then printTokens CoffeeScript.tokens code

options      = {}
sources      = []
optionParser = null
localPath    = /^.\//

# Run `coffee` by parsing passed options and determining what action to take.
# Many flags cause us to divert before compiling anything. Flags passed after
