-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.mjs
32 lines (23 loc) · 852 Bytes
/
index.mjs
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
import { Generate } from './src/Generate.mjs'
import { config } from './src/data/config.mjs'
import fs from 'fs'
function getTimestamp() {
const currentDate = new Date()
const year = currentDate.getFullYear()
const month = String( currentDate.getMonth() + 1 ).padStart( 2, '0' )
const day = String( currentDate.getDate() ).padStart( 2, '0' )
const hours = String( currentDate.getHours() ).padStart( 2, '0' )
const minutes = String( currentDate.getMinutes() ).padStart( 2, '0' )
const formattedDate = `${year}-${month}-${day} ${hours}:${minutes}`
const dateString = `Last update: ${formattedDate}`
return dateString
}
const generate = new Generate()
let result = ''
result += generate.getReadme()
result += '\n\n' + getTimestamp()
fs.writeFileSync(
config['readme']['output'],
result,
'utf-8'
)