-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathwork.js
More file actions
29 lines (21 loc) · 850 Bytes
/
work.js
File metadata and controls
29 lines (21 loc) · 850 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
/**
* @desc work
* @author MiyueFE <https://github.com/miyuesc>
* @since 2024/9/3 10:04
*/
import { writeFileSync, readFileSync } from "fs"
import { getCurrentDate, replaceKeywords } from "./utils/index.js";
import { processIssues } from "./works/issue.js";
import {processColumnArticles} from "./works/juejin.js";
async function mdGenerator() {
const column = await processColumnArticles()
const questions = await processIssues()
const readmePrefix = readFileSync('./templates/prefix.md', 'utf-8')
const readmeSuffix = readFileSync('./templates/suffix.md', 'utf-8')
const currentDate = getCurrentDate()
const md = `${replaceKeywords(readmePrefix, () => currentDate)}\n${column}\n${questions}\n${readmeSuffix}`
await writeFileSync(`./README.md`, md)
console.log("README 写入成功~")
}
// getCurrentDate()
mdGenerator()