问题
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.
来源:https://stackoverflow.com/questions/30779915/is-it-possible-to-use-fs-filesystem-module-inside-page-executed-by-phantomjs