get a list of website resources via phantomjs
npm install phantastic
var phantastic = require("phantastic")({
cache: {
// see https://npmjs.com/package/lru-files
dir: "/path/to/cache/dir",
files: 100,
size: "1 GB",
age: "1 Day"
}
});
// fetch single site
phantastic.fetch("https://www.example.com/", function(err, data){
if (err) return console.log(err);
console.log(data);
});
data is an array of resource object. they look like this
[{
url: 'https://www.example.org/resource',
domain: 'www.example.org',
size: 2440,
time: 87,
content: 'mime/type',
cookies: [{
name: "Some-Cookie",
size: 1024,
valid: 356
}]
}]