2022-07-01 23:12:47 +02:00
|
|
|
import fs from 'node:fs'
|
2022-03-14 09:09:46 +01:00
|
|
|
|
|
|
|
import { render } from '../index.js'
|
|
|
|
|
|
|
|
const jsonResumeURL = new URL('../../resume.json', import.meta.url)
|
|
|
|
const publicResumeURL = new URL(
|
|
|
|
'../../public/curriculum-vitae.html',
|
|
|
|
import.meta.url
|
|
|
|
)
|
|
|
|
|
|
|
|
const dataResumeStringJSON = await fs.promises.readFile(jsonResumeURL, {
|
|
|
|
encoding: 'utf-8'
|
|
|
|
})
|
|
|
|
const dataResumeJSON = JSON.parse(dataResumeStringJSON)
|
|
|
|
const dataResumeIndexHTML = await render(dataResumeJSON)
|
|
|
|
await fs.promises.writeFile(publicResumeURL, dataResumeIndexHTML, {
|
|
|
|
encoding: 'utf-8'
|
|
|
|
})
|
2022-07-23 23:00:58 +02:00
|
|
|
|
|
|
|
console.log('Resume generated successfully!')
|
|
|
|
console.log(`See it at ${publicResumeURL}`)
|