budget json

This commit is contained in:
soulgalore 2019-02-10 20:44:02 +01:00
parent 76526b3e7b
commit 99972f31d8
2 changed files with 11 additions and 1 deletions

View File

@ -204,3 +204,13 @@ docker run --rm -v "$(pwd)":/sitespeed.io sitespeedio/sitespeed.io:{% include ve
~~~
It will create a *budget.tap* in the outputFolder.
### JSON
You can output the result of the budget as JSON:
~~~bash
docker run --rm -v "$(pwd)":/sitespeed.io sitespeedio/sitespeed.io:{% include version/sitespeed.io.txt %} https://www.sitespeed.io/ --budget.configPath myBudget.json --budget.output json -b chrome -n 5
~~~
It will create a *budgetResult.json* in the outputFolder.

View File

@ -5,7 +5,7 @@ const fs = require('fs'),
path = require('path');
exports.writeJson = function(results, dir) {
const file = path.join(dir, 'budget-result.json');
const file = path.join(dir, 'budgetResult.json');
log.info('Write budget to %s', path.resolve(file));
fs.writeFileSync(file, JSON.stringify(results, null, 2));
};