In this chapter, we will cover:
Inspecting the version at runtime
Managing cookies with the phantom object
Specifying a path for external scripts
Setting up a global PhantomJS error handler
Controlling the exit status of a PhantomJS script
Inspecting command-line arguments
Inspecting system environment variables
Saving a file from a PhantomJS script
Reading a file from PhantomJS
Creating a custom module for PhantomJS
Loading custom modules in PhantomJS