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

@projektemacher/vivliostyle-batch-cli

v0.1.2

Published

A vivliostyle-cli with more options for batch processing

Readme

Vivliostyle CLI Wrapper

A powerful CLI wrapper for Vivliostyle with enhanced static asset handling and HTML parsing capabilities.

Features

  • Build PDF, EPUB, and WebPub output from HTML or publication manifests
  • Preview documents in the browser with live reloading
  • Automatic detection and mapping of static assets from HTML (<link>, <script>, <img>, etc.)
  • Support for custom static asset mappings via --static
  • Map external URLs (CDNs, etc.) to local directories using --asset-base
  • Ignore specific assets with --ignore-asset
  • Forward extra Vivliostyle options using --
  • Debug mode with detailed logging
  • Temporary file management and cleanup

Installation

#npm install -g @vivliostyle/cli
npm install -g @projektemacher/vivliostyle-batch-cli

Usage

Build a PDF from an HTML file

vivliostyle-cli -i index.html -o output.pdf

Preview an HTML file in the browser

vivliostyle-cli -i index.html --preview

Build with custom static asset mappings

vivliostyle-cli -i index.html -o output.pdf \
  --static /assets:/home/user/project/assets \
  --static /fonts:/home/user/project/fonts

Map an external CDN URL to a local cache

vivliostyle-cli -i index.html -o output.pdf \
  --asset-base https://cdn.example.com/=/home/user/cdn-cache

Pass extra Vivliostyle options after --

vivliostyle-cli -i index.html -o output.pdf -- --timeout 60000 --debug

Options

| Option | Description | | ---------------------------------- | ---------------------------------------------------------------------------- | | -i, --input <input> | Input HTML or publication manifest file (required) | | -o, --output <file> | Output file path (default: output.pdf) | | --title <title> | Document title (overrides source) | | --author <author> | Document author | | --language <lang> | Document language tag (e.g. en, de, ja) (default: de) | | --static <mapping> | Map virtual path to local path: /virtual/path:/local/path (repeatable) | | --no-scripts | Do not map <script src> tags as static assets (recommended for PDF builds) | | --asset-base <urlBase=localBase> | Map URLs starting with urlBase to files under localBase (repeatable) | | --ignore-asset <path> | Skip specific virtual paths when deriving static mappings (repeatable) | | --cwd <dir> | Working directory for Vivliostyle (default: directory of --input) | | --format <format> | Output format: pdf, epub, or webpub (default: pdf) | | --log-level <level> | Log level: silent, info, verbose, or debug (default: info) | | --mode <mode> | Execution mode: build or preview (default: build) | | --preview | Shorthand for --mode preview — open result in browser | | -d, --debug | Enable debug mode (sets log level to debug) |

Notes

  • HTML input (.html/.htm) is auto-detected by file extension.
  • For HTML input, <link href> and <script src> tags are parsed and automatically mapped.
  • Options after -- are forwarded verbatim to Vivliostyle.
  • --debug automatically sets --log-level to debug.
  • --preview and --mode preview are equivalent.
  • In preview mode, Vivliostyle serves everything via its own Vite server.
  • In build mode, an Express server is started to serve assets.
  • --asset-base local directories are also used as fallback roots for CSS-referenced assets (fonts, images, etc.).

Examples

# Build a PDF from an HTML file
vivliostyle-cli -i index.html -o output.pdf

# Preview an HTML file in browser
vivliostyle-cli -i index.html --preview

# Build with explicit static asset mapping
vivliostyle-cli -i index.html -o output.pdf \
  --static /assets:/dist/assets --static /fonts:/dist/fonts

# Map an absolute CDN URL to a local directory
vivliostyle-cli -i index.html -o output.pdf \
  --asset-base https://cdn.example.com/=/home/user/cdn-cache

# Pass extra Vivliostyle options after --
vivliostyle-cli -i index.html -o output.pdf -- --timeout 60000

License

MIT