Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/danielroe/roe.dev. This is the code and content for my personal website, built in Nuxt. roe.dev
Something went wrong. Try again.
419 B · 15 lines
TypeScript
at ci/nightly
12345678910111213141516import { createHash } from 'node:crypto'import { join } from 'node:path'import { tmpdir } from 'node:os'import { promises as fsp } from 'node:fs'
export async function writeTempFile(fileName: string, html: string) { const hashedFileName = createHash('md5').update(fileName).digest('hex') + '.html'
const filePath = join(tmpdir(), hashedFileName)
await fsp.writeFile(filePath, html)
return filePath}