diff --git a/README.md b/README.md index 269c614..e0c0d13 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Generating resumes with JSONResume! Makes use of the `resumed` CLI to generate r ## Features - :white_check_mark: Supports building multiple resumes at once using a glob pattern -- :white_check_mark: Support for JSON _and_ YAML input files +- :white_check_mark: Support for JSON *and* YAML input files - :white_check_mark: Support for local and remote themes - :white_check_mark: Support for PDF and HTML output diff --git a/src/convert.js b/src/convert.js index bb5a82d..539531c 100644 --- a/src/convert.js +++ b/src/convert.js @@ -1,26 +1,26 @@ // Used to convert a given HTML file to a PDF file -import * as fs from "fs"; -import puppeteer from "puppeteer"; +import * as fs from 'fs' +import puppeteer from 'puppeteer' -const htmlFile = process.argv[2]; +const htmlFile = process.argv[2] const pdfFile = process.argv[3]; (async () => { const browser = await puppeteer.launch({ - headless: "new", - executablePath: "/usr/bin/chromium-browser", + headless: 'new', + executablePath: '/usr/bin/chromium-browser', args: [ - "--no-sandbox", - "--headless", - "--disable-gpu", - "--disable-dev-shm-usage", - ], - }); - const page = await browser.newPage(); - const html = fs.readFileSync(htmlFile, "utf8"); - await page.setContent(html); - await page.pdf({ path: pdfFile, format: "A4" }); + '--no-sandbox', + '--headless', + '--disable-gpu', + '--disable-dev-shm-usage' + ] + }) + const page = await browser.newPage() + const html = fs.readFileSync(htmlFile, 'utf8') + await page.setContent(html) + await page.pdf({ path: pdfFile, format: 'A4' }) - await browser.close(); -})(); + await browser.close() +})()