Is it possible do read/write files inside a CasperJS Script ?
var fs = require('fs');
var data = fs.readFileSync('testdata.data', 'utf-8');
console.log(data);
Calling casperjs fileio.js
returns:
'undefined' is not a function
Even after running npm install fs
.
Bonus point if not : explain why ?