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

bookcover-node

v0.10.0

Published

Generate print-ready book covers. Part of the [bookcover](https://github.com/gracious-tech/bookcover) generation system.

Readme

bookcover-node

Generate print-ready book covers. Part of the bookcover generation system.

npm install bookcover-node

Example cover

This is a Node.js wrapper for the book cover generator. Writes files to a temp directory, spawns the typst CLI binary, and reads back the compiled output.

Requires typst on $PATH.

See the schema reference which is passed as an argument and is what actually configures the cover design.

import {generate} from 'bookcover-node'

generate(options): Promise<GenerateResult>

interface GenerateOptions {
    schema: unknown              // raw schema (see above)
    input_path: string           // directory to search for background image
    output_path: string          // where to write the output file
    format?: 'pdf'|'svg'|'png'  // default: 'pdf'
    ppi?: number                 // PNG resolution, default: 144
    split?: boolean              // also write front/back/spine panel files
    assets_dir?: string          // root of the assets tree (see "Assets" below)
    fonts_dir?: string           // fonts tree if kept elsewhere, default: <assets_dir>/fonts
    typst_path?: string          // typst CLI binary, default: 'typst' from $PATH
    custom_fonts?: CustomFont[]  // user-uploaded font families (from typst-fonts)
}

interface GenerateResult {
    output_path: string
    split_paths?: {front: string, back: string, spine?: string}
}

Assets

The Typst templates are bundled inside bookcover-core itself (tied to the exact installed version — no setup needed). Generating still requires a local fonts collection, which does not ship inside the npm packages. Set it up once and pass its path as assets_dir (or fonts_dir directly):

# Fonts — download the curated families + Noto fallbacks named by the repo's font config
curl -O https://raw.githubusercontent.com/gracious-tech/bookcover/main/font_config.json
npx typst-fonts-download --fonts assets/fonts --config font_config.json

That produces the expected layout:

assets/
    fonts/      manifest.json, <family>/, _noto/<family>/

Inside the bookcover repo itself assets_dir can be omitted — it defaults to the repo's own assets/ dir.

Example

import {generate} from 'bookcover-node'

await generate({
    schema: {
        title1: 'My Book',
        author: 'Jane Doe',
        page_count: 200,
        printer: {service: 'kdp', binding_type: 'paperback', ink_type: 'bw', paper_type: 'white'},
        size_id: 'us_trade',
    },
    input_path: '.',
    output_path: './cover.pdf',
    assets_dir: './assets',
})