The File System Module has many APIs to deal with files and directories. You can create/write and delete a file/directory. To start using the file system module you must require a reference to the fs module.
var fs = require('fs');
There are two properties available for file system module: Separator and Working Directory. Let us understand them in detail.
It tells you the separator used for the file paths.
Its syntax is as follows −
fs.seperator
var fs = require('fs'); console.log(fs.seperator); phantom.exit();
The above program generates the following output.
undefined
The working directory is the directory in which PhantomJS executes.
Its syntax is as follows −
var fs = require('fs'); fs.workingDirectory;
var fs = require('fs'); console.log(fs.workingDirectory); phantom.exit();
The above program generates the following output.
C:/phantomjs/bin