-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbench.js
21 lines (18 loc) · 882 Bytes
/
bench.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const fetch = require('node-fetch');
const {parse} = require('.');
const RX_HEADER = /\/\*\s*==UserStyle==[\s\S]+?==\/UserStyle==\s*\*\//;
// these cases are picked from https://github.com/search?o=desc&q=usercss&s=updated&type=Repositories
const cases = [
'https://raw.githubusercontent.com/StylishThemes/GitHub-Dark/master/github-dark.user.css',
'https://github.com/stonecrusher/stylus-UserCSS/raw/master/WEBde/webde-geputzt.user.css',
'https://github.com/AviSynthPlus/twiFixWebLite/raw/devel/twiFixWebLite.user.css',
'https://github.com/FlandreDaisuki/My-Browser-Extensions/raw/master/usercss/FaceBullshit.user.css'
];
(async () => {
for (const url of cases) {
console.log(url);
const text = await (await fetch(url)).text(); // eslint-disable-line no-await-in-loop
const {metadata} = parse(text.match(RX_HEADER)[0]);
console.log(metadata);
}
})();