Is it possible to use the "fs" module (file system) inside a page executed by PhantomJS?

I want to have access to the file system on a page that runs using the PhantomJS browser without a browser.

I will catch an error when the JS code tries to interact with the file system

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

Is there any hack / plugin for PhantomJS that allows this?

PS I am using a headless test runner based on PhantomJS ( teaspoon ), and I want to save some data from the tests to the file system.

0
source share

Source: https://habr.com/ru/post/989470/


All Articles