Take a code segment of the fs.js for example:
exports.write = function (path, content, modeOrOpts) {
var opts = modeOrOptsToOpts(modeOrOpts);
// ensure we open for writing
if ( typeof opts.mode !== 'string' ) {
opts.mode = 'w';
} else if ( opts.mode.indexOf('w') == -1 ) {
opts.mode += 'w';
}
var f = exports.open(path, opts);
f.write(content);
f.close();
};
Now I'm confused with the exports object. You can find it in every PhantomJS module but I found no where to define the exports object.
Could anyone give me some suggestions about the place where defined the exports object?
Don't be confused with the exports in NodeJS. It's PhantomJS...