-
Notifications
You must be signed in to change notification settings - Fork 39
/
run.js
69 lines (66 loc) · 1.84 KB
/
run.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env node
"use strict";
const program = require("commander");
const execute = require("./index");
program
.version(require("./package.json").version)
.option(
"-s, --sites [sites]",
"a comma delimited list of site urls to analyze with Lighthouse",
(str) => str.split(","),
[]
)
.option(
"-f, --file [path]",
"an input file with a site url per-line to analyze with Lighthouse"
)
.option(
"-p, --params <params>",
'extra parameters to pass to lighthouse cli for each execution e.g. -p "--perf --quiet"'
)
.option("-h, --html", "generate an html report alongside the json report")
.option("--csv", "generate a csv report alongside the json report")
.option(
"-o, --out [out]",
`the output folder to place reports, defaults to '${execute.OUT}'`
)
.option(
"--score <threshold>",
`average score for each site to meet (1-100)`,
Number
)
.option(
"--accessibility <threshold>",
`accessibility score for each site to meet (1-100)`,
Number
)
.option(
"--performance <threshold>",
`performance score for each site to meet (1-100)`,
Number
)
.option(
"--best-practices <threshold>",
`best practice score for each site to meet (1-100)`,
Number
)
.option(
"--seo <threshold>",
`seo score for each site to meet (1-100)`,
Number
)
.option(
"--pwa <threshold>",
`pwa score for each site to meet (1-100)`,
Number
)
.option("--fail-fast", `fail as soon as a budget threshold is not met`)
.option(
"-g, --use-global",
"use a global lighthouse install instead of the dependency version"
)
.option("-v, --verbose", "enable verbose logging")
.option("--no-report", "remove individual json reports for each site")
.option("--print", "print the final summary to stdout")
.parse(process.argv);
execute(program);