Skip to content

Commit

Permalink
add CSV data
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Nov 1, 2024
1 parent 5430dd9 commit 7249933
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/cacheCycles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ jobs:
- uses: ljharb/actions/node/install@main

- run: node cacheCycles.mjs
name: cache EOL data

- run: node csv.mjs
name: update cached CSV data

- run: git checkout data

Expand Down
16 changes: 16 additions & 0 deletions csv.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { join } from 'path';
import { writeFile } from 'fs/promises';
import data from './out/data.json' with { type: 'json' };

const dataRows = Object.entries(data);

const csv = [
['package', 'version', 'released', 'eol'],
].concat(dataRows.flatMap(([p, os]) => os.map(x => (
[p, x.latest, x.latestReleaseDate, x.eol]
))));

const outDir = join(process.cwd(), 'out');
const outFile = join(outDir, 'data.csv');

await writeFile(outFile, csv.join('\n'));

0 comments on commit 7249933

Please sign in to comment.