-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.js
More file actions
30 lines (29 loc) · 796 Bytes
/
build.js
File metadata and controls
30 lines (29 loc) · 796 Bytes
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
var https = require('https')
var URL = 'https://spdx.org/licenses/licenses.json'
https.get(URL, function (response) {
var chunks = []
response
.on('data', function (chunk) {
chunks.push(chunk)
})
.once('error', function (error) {
console.error(error)
process.exit(1)
})
.once('end', function () {
var body = Buffer.concat(chunks)
var parsed = JSON.parse(body)
var ids = parsed.licenses
.filter(function (license) {
return license.isOsiApproved
})
.filter(function (license) {
return license.licenseId.indexOf(' WITH ') === -1
})
.map(function (license) {
return license.licenseId
})
.sort()
console.log(JSON.stringify(ids, null, 2))
})
})