UNPKG

@eighty4/changelog

Version:
18 lines (17 loc) 403 B
import { readFile } from 'node:fs/promises'; export async function readChangelogFile(p) { try { return await readFile(p, 'utf-8'); } catch (e) { if (e !== null && e instanceof Error && 'code' in e && e.code === 'ENOENT') { throw new Error(p + ' does not exist'); } else { throw e; } } }