Is it possible to use 'fs' (filesystem) module inside page executed by PhantomJS?

362 Views Asked by At

I want to have access to filesystem on a page that is rendering by PhantomJS headless browser.

I catch an error when JS code is trying to interact with filesystem

var fs = require('fs');
...
ReferenceError: Can't find variable: require

Is there some hack/plugin to PhantomJS that allows to do that?

P.S. I'm using headless tests runner based on PhantomJS (teaspoon) and I want to store some data from tests on filesystem.

0

There are 0 best solutions below