-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathindex.js
executable file
·56 lines (47 loc) · 1.48 KB
/
index.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
const DefinitionFile = require('./src/definition-file')
const GithubScraper = require('./src/scraper-github')
const NodejsOrgScraper = require('./src/scraper-nodejs_org')
const scrapers = {
nodejs: new NodejsOrgScraper({
displayName: 'nodejs',
baseUri: 'https://nodejs.org/dist/'
}),
'nodejs-pre': new NodejsOrgScraper({
displayName: 'nodejs release candidate',
baseUri: 'https://nodejs.org/download/rc/'
}),
'nodejs-nightly': new NodejsOrgScraper({
displayName: 'nodejs nightly',
baseUri: 'https://nodejs.org/download/nightly/'
}),
chakracore: new NodejsOrgScraper({
name: 'chakracore',
baseUri: 'https://nodejs.org/download/chakracore-release/'
}),
'chakracore-pre': new NodejsOrgScraper({
name: 'chakracore',
displayName: 'chakracore release candidate',
baseUri: 'https://nodejs.org/download/chakracore-rc/'
}),
'chakracore-nightly': new NodejsOrgScraper({
name: 'chakracore',
displayName: 'chakracore nightly',
baseUri: 'https://nodejs.org/download/chakracore-nightly/'
}),
graal: new GithubScraper({
name: 'graal+ce',
org: 'oracle',
repo: 'graal',
filterReleases: releases =>
releases
.filter(r => /^vm-/.test(r.tag_name))
.map(r => ({
tag_name: r.tag_name.replace(/^vm-/, ''),
assets: r.assets
}))
})
}
module.exports = function scrape (options) {
DefinitionFile.configure(options)
options.run.forEach(scraper => scrapers[scraper].scrape(options))
}