Progressive web metrics at your fingertipz. 💅
pwmetrics
CLI tool and lib to gather performance metrics via Lighthouse.
P.S: This module is IN BETA, so you must be ready for anything 😉
GET IT: npm install --global pwmetrics
or npm install --save pwmetrics
Sample CLI usage:
1
2
| # run Chrome with port 9222 open
chrome --remote-debugging-port=9222 --no-first-run --user-data-dir=$(mktemp -d -t pwm.XXXXX)
|
1
2
| # run pwmetrics with your url
pwmetrics https://jsfeatures.in
|
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
| $ pwmetrics --json https://jsfeatures.in
{
"timings": [
{
"name": "First Contentful Paint",
"value": 1875.337
},
{
"name": "First Meaningful Paint",
"value": 1970.7
},
{
"name": "Median Visual Completion",
"value": 1997
},
{
"name": "First Visual Change",
"value": 1917
},
{
"name": "Visually Complete 100%",
"value": 2004
},
{
"name": "Time to Interactive",
"value": -1
},
{
"name": "Visually Complete 85%"
},
{
"name": "Navigation Start",
"value": 0
}
],
"timestamps": [
303915241.28
]
}
|
API:
1
2
3
| const PWMetrics = require('pwmetrics');
new PWMetrics('https://jsfeatures.in', opts); // opts => {data:fileName} for now.
|
GIF FTW!: