UNPKG

resumefy

Version:

A simple toolkit to bring your JSON Resume to life

23 lines (22 loc) 598 B
import { readFile } from 'fs/promises'; import { log } from './log.js'; import { validateObject } from '../validate/validate.js'; export const validate = async (filename) => { let resumeObject; try { resumeObject = JSON.parse(await readFile(filename, 'utf-8')); } catch (err) { log.error('Error reading file ❌'); log.error(err); return; } try { await validateObject(resumeObject); log.success('Resume file is valid 🎉'); } catch (err) { log.error('Resume is invalid ❌'); log.error(err); } };