-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.ejscrc.mjs
More file actions
20 lines (17 loc) · 687 Bytes
/
Copy path.ejscrc.mjs
File metadata and controls
20 lines (17 loc) · 687 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import fs from "fs-extra";
const downloads = fs.readJsonSync("data/package-stats.json");
const packages = fs.readJsonSync("data/data.json");
const downloadDates = Object.keys(downloads.dailyDownloads);
const currentTime = new Date().toISOString().replace('T', ' ').split('.')[0];
let mdString = fs.readFileSync("README.md", "utf8").replace(/<!--GAMFC-->.*?<!--GAMFC-END-->/, `<!--GAMFC-->${currentTime}<!--GAMFC-END-->`);;
fs.writeFileSync("README.md", mdString);
export default {
data: {
"templates/index.ejs": {
packages: [...packages],
downloads: downloads,
firstDate: downloadDates[0],
lastDate: downloadDates[downloadDates.length - 1],
}
},
};