mirror of
https://github.com/BradNut/awesome-uses
synced 2025-09-08 17:40:31 +00:00
From start scripts needed to be run with node 13 (esm support) Because data.js was a esm export, and needed to be compiled Moved all scripts to commontjs, and data.js file So can be imported by scripts without compiling
13 lines
396 B
JavaScript
13 lines
396 B
JavaScript
const fs = require('fs');
|
|
const data = require('../src/data.js');
|
|
|
|
/** @type {string} */
|
|
const readmeTemplate = fs.readFileSync('./scripts/readme-template.md', 'utf8');
|
|
const formatedData = data
|
|
.map(page => `* [${page.name}](${page.url}) — ${page.description}`)
|
|
.join('\r\n');
|
|
|
|
fs.writeFileSync(
|
|
'generated-readme.md',
|
|
readmeTemplate.replace('###DATA_PLACEHOLDER###', formatedData)
|
|
);
|