npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

pdfkit-fresh-resume

v1.1.0

Published

Convert a resume (CV) in FRESH format to PDF with PDFKit. This includes an example resume JSON and an example theme.

Downloads

7

Readme

npm version

Toolkit for rendering a resume PDF with PDFKit.

Convert a resume (CV) in FRESH format to PDF with PDFKit. This includes an example resume JSON and an example theme. Inspired by HackMyResume, but I wanted more low-level control over the PDF output.

The previous PDF version of my resume was generated with a FRESH resume JSON to XML to PDF with with XSL:FO and after every change I manually transform to PDF and have to close and open Adobe Reader (there is no refresh button and the PDF is locked when open in Reader so it will not overwrite when transforming). As a front-end developer I want to leverage browser sync to make the develop/review cycle more efficient.

The FRESH resume JSON, photo and the generated PDF for my own resume are not public, but I did include an example json (./example-resume.json), photo (./example-photo.jpg) and PDF (./output/example-output.png).

Details about how the preview is generated:

  1. A Node script runs when the sources change and generates the PDF, but also a JS with a data-uri version of the PDF as a variable.
  2. A static html preview.html is served that includes the data-uri JS.
  3. To do: Browsersync will be used to watch changes to the data-uri JS and will refresh preview.html in the browser.

Run

Because async/await is used, NPM 9 is required.

  • npm use 9
  • npm i
  • node index.js run examples/example-resume.json output.pdf

or globally:

  • npm use 9
  • npm i -g pdfkit-fresh-resume
  • pdfkit-fresh-resume run ~/.npm/pdfkit-fresh-resume/example-resume.json output.pdf

options:

  • With alternative template: pdfkit-fresh-resume run ~/.npm/pdfkit-fresh-resume/example-resume.json output.pdf -t ~/.npm/pdfkit-fresh-resume/app/template/otherTemplate.js

Running with -w/--watch

This is an experimental feature

  • pdfkit-fresh-resume run ~/.npm/pdfkit-fresh-resume/example-resume.json output.pdf -w
  • Run http-server in another terminal
  • Open http://localhost:8080/preview.html in the browser
  • After updating the template or the input JSON, the console will log "🔥Hot update". After that refresh the browser while clearing the cache to see changes.

TODO

  • Implement a full template that can render an entire resume.json
  • Linting: eslint app/**/*.js fails because pdf.js contains async and that is an experimental feature which can't be parsed by eslint directly, this might be fixed by using eslint-babel parser.
  • See also https://github.com/MrRio/jsPDF (.docx support: https://github.com/MrRio/DOCX.js)