Open jean opened 6 years ago
I have just fixed the above issue. PFB the code changes that would actually fix yslow. (I picked up the fix from stackoverflow and updated the yslow code with the fix).
require('fs').readFile('XXX.har', function (err, data) { var har = JSON.parse(data); var YSLOW = require('yslow').YSLOW; var jsdom = require('jsdom'); const { JSDOM } = jsdom; const { document } = (new JSDOM('')).window; global.document = document; var res = YSLOW.harImporter.run(document, har, 'ydefault'); var content = YSLOW.util.getResults(res.context, 'basic'); console.log(content); });
It does pull in a bunch of packages, but doesn't result in any
yslow
executable:The executable is hiding in the
.tgz
file, which isn't unpacked:Unpacking it manually doesn't help much:
I'm guessing it's too old.