Chapter 7. Working with Files

Reading and writing to files are some of the basic tasks in programming. These functions are commonly used in reading and saving the configuration of the application, persisting important data, or for logging application activities. PhantomJS provides a rich FileSystem API that supports most of the file handling and operations needed. The API contains similar functions that can be found in other programming language. In this chapter we will cover the checking, loading, and writing of files using PhantomJS's built-in file handling capabilities.

PhantomJS FileSystem API

The FileSystem module of PhantomJS provides mechanisms to manipulate files, folders, paths, and contents. It is also capable of handling file object streams. ...

Get Getting Started with PhantomJS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.