-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
33 lines (27 loc) · 791 Bytes
/
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
'use strict';
const fs = require('fs');
let { getAllImages } = require('./images');
let main = async () => {
let images = await getAllImages()
let out = []
images.forEach(image => {
image['packages'].forEach(packageClass => {
packageClass['pkgs'].forEach(pkg => {
if (pkg.name.includes('openssl') && pkg.version.startsWith('3')) {
out.push(image)
}
else if (pkg.name.includes('nodejs') && (
pkg.version.startsWith('17')
|| pkg.version.startsWith('18')
|| pkg.version.startsWith('19'))) {
out.push(image)
}
})
})
});
fs.writeFile('report.json', JSON.stringify(out), function (err) {
if (err) return console.log(err);
console.log('report generated!');
});
}
main()