Skip to content

Commit

Permalink
fix(init): create require to import JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
rbardini committed Jan 17, 2023
1 parent e7b634e commit b1b361f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/init.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { writeFile } from 'node:fs/promises'
import { createRequire } from 'node:module'

// ESM can't import JSON yet, fallback to `require`
const require = createRequire(import.meta.url)

export const init = (filename: string) => {
const resume = require('resume-schema/sample.resume.json')
Expand Down

0 comments on commit b1b361f

Please sign in to comment.