From 8d37f3b683c7a4cdf661efc3d85c2bcc34ab368b Mon Sep 17 00:00:00 2001 From: soulgalore Date: Mon, 3 May 2021 19:39:32 +0200 Subject: [PATCH] Store result --- bin/sitespeed.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/sitespeed.js b/bin/sitespeed.js index 94ae48376..88b19191f 100755 --- a/bin/sitespeed.js +++ b/bin/sitespeed.js @@ -4,6 +4,7 @@ 'use strict'; +const fs = require('fs'); const cli = require('../lib/cli/cli'); const sitespeed = require('../lib/sitespeed'); @@ -15,6 +16,10 @@ async function run(options) { throw new Error('Errors while running:\n' + result.errors.join('\n')); } + if (options.storeResult) { + fs.writeFileSync('result.json', JSON.stringify(result)); + } + if ( parsed.options.budget && Object.keys(result.budgetResult.failing).length > 0