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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@skxv/leafmark

v0.2.1

Published

Comprehensive Markdown to PDF and HTML builder powered by Pandoc.

Readme

leafmark

Comprehensive Markdown to PDF and HTML, powered by Pandoc.

Usage

pnpx @skxv/leafmark ./folder/with/markdown

If you are already in a markdown project folder, run:

pnpx @skxv/leafmark

Leafmark also supports the older copied project layout where markdown lives in project/.

Commands

pnpx @skxv/leafmark                    # build ./dist/output.pdf
pnpx @skxv/leafmark ./project          # read ./project, write ./dist/output.pdf
pnpx @skxv/leafmark --output ./build   # write ./build/output.pdf
pnpx @skxv/leafmark --output-format docx  # build output.docx
pnpx @skxv/leafmark --html             # build output.pdf and thesis.html
pnpx @skxv/leafmark --html-only        # build thesis.html only
pnpx @skxv/leafmark watch              # rebuild continuously
pnpx @skxv/leafmark o                  # arrange chapters with arrow keys
pnpx @skxv/leafmark organize           # same as `o`
pnpx @skxv/leafmark init ./my-project  # create a starter markdown folder
pnpx @skxv/leafmark theme init ./theme # create a theme repository scaffold
pnpx @skxv/leafmark theme list         # list builtin themes
pnpx @skxv/leafmark theme use default  # install a builtin theme
pnpx @skxv/leafmark theme use https://github.com/user/theme-repo
pnpx @skxv/leafmark doctor             # check external tools
pnpx @skxv/leafmark status             # word and character counts (no build)

Bundles are supported when a subfolder contains its own .leafmark/config.json or _frontmatter.md:

pnpx @skxv/leafmark ./project-folder analysis

Input Format

A standalone folder should contain:

.leafmark/
  config.json
introduction.md
method.md
sources.bib

.leafmark/config.json is optional, but it is where Leafmark saves chapter order, theme choices, and project extensions. _frontmatter.md is still supported for YAML metadata, but it is no longer required. Markdown chapter files do not need numeric prefixes. When no saved order exists, numbered files sort first by numeric prefix and all other markdown files sort naturally by filename.

Example .leafmark/config.json:

{
  "metadata": {
    "title": "My Leafmark Project",
    "author": ["Your Name"],
    "bibliography": "sources.bib"
  },
  "order": ["introduction.md", "method.md"],
  "template": "templates/report.latex",
  "fonts": {
    "pdf": "Aptos",
    "mono": "JetBrains Mono",
    "css": ["fonts/web.css"],
    "latexInclude": "fonts/custom-fonts.tex"
  },
  "plugins": [
    "plugins/cleanup.lua",
    {
      "luaFilter": "plugins/html-only.lua",
      "htmlArgs": ["--section-divs"]
    }
  ],
  "pandoc": {
    "args": ["--wrap=none"],
    "pdfArgs": [],
    "htmlArgs": []
  }
}

Date formatting

Set date to an ISO value (2026-02-16) and optionally add date-format with a Unicode LDML-style pattern (same family as date-fns and Java). Leafmark formats the date before it reaches Pandoc (title page, footer, HTML header).

date: 2026-02-16
date-format: dd/MM/yyyy

Common tokens: dd (day), MM or mm (month), yyyy or YYYY (year), yy (short year), MMMM / MMM (month name). Moment-style DD is also accepted. Use lang to control month names (for example lang: da with d. MMMM yyyy).

Hyphenation

By default, PDF and HTML output allow inside-word hyphenation when a line is full. Set hyphens: false in metadata or _frontmatter.md to disable hyphenation and wrap lines at spaces instead:

hyphens: false

Themes

Builtin themes are packaged like standalone theme repositories:

src/themes/default/
  .leafmark/
    theme.json
    templates/
    includes/
    css/

A GitHub theme should expose the same .leafmark folder at the repository root. Running theme use copies the theme files into your project under .leafmark/theme/ and updates .leafmark/config.json.

List packaged themes with:

pnpx @skxv/leafmark theme list

Builtin themes:

  • default - current Leafmark thesis style with sans text and code-friendly output.
  • classic - serif academic report with restrained headings and traditional spacing.
  • compact - space-efficient single-column style for drafts and review copies.
  • multicolumn - two-column article layout for dense notes, papers, and handouts.
  • cv - one-page CV layout with structured frontmatter and Markdown work experience.

Apply a builtin theme from your project folder with:

pnpx @skxv/leafmark theme use cv

Theme manifests can provide default config and metadata. Project config and project frontmatter override those defaults, so themes can define custom frontmatter fields without taking ownership of the user's content.

CV Theme

The cv theme is for a one-page resume or application CV. It uses structured frontmatter for profile, contact details, education, skills, and languages. The Markdown chapter content is treated as the work experience column.

Minimal _frontmatter.md:

---
title: Alex Morgan
subtitle: Frontend Developer
profile: |
  Frontend developer with experience building maintainable user interfaces,
  design systems, and content-heavy web products.
contact:
  website: alexmorgan.dev
  email: [email protected]
  phone: "+1 555 010 2000"
education-title: Education
education:
  - institution: Example University
    degree: BSc Computer Science
    period: 2021 - 2024
    description: Focused on web engineering, databases, and human-computer interaction.
skills-title: Skills & languages
skills-label: "Skills:"
skills:
  - Figma
  - Git
  - Next.js
  - React
  - TypeScript
  - UI design
languages-label: "Languages:"
languages:
  - English (native)
  - Spanish (professional working proficiency)
---

Example experience.md:

# Acme Studio / Frontend Developer

2024 - present

Built production user interfaces in React and Next.js, collaborated with
designers on reusable components, and improved frontend delivery workflows.

# Northwind Labs / Web Developer

2023 - 2024

Developed marketing and product pages, maintained a shared design system, and
worked with stakeholders to turn content requirements into shipped features.

Supported CV fields:

  • title and subtitle render as the name and role.
  • profile renders as the introductory paragraph below the header.
  • contact.website, contact.email, and contact.phone render in the top-right contact block.
  • contact.lines can add extra contact lines.
  • experience-title changes the left-column heading. The default is Experience.
  • education-title changes the education heading. The default is Education.
  • education is a list of entries with institution, degree, period, and description.
  • skills-title, skills-label, and skills control the skills block.
  • languages-label and languages control the language block.
  • sidebar can add extra Markdown-supported content below the right column.

Create a new theme scaffold with:

pnpx @skxv/leafmark theme init ./my-theme

The scaffold includes .leafmark/theme.json, template/include/CSS folders, an ignored project/ test document, and INSTRUCTIONS.md for theme authors and agents.

External Tools

Leafmark is an npm package, but PDF generation depends on system tools:

  • pandoc
  • xelatex or pdflatex
  • pdfunite for optional coverpage merging

On first run, Leafmark checks for missing tools and asks whether it should try to install them. You can also run:

pnpx @skxv/leafmark doctor