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

@illusions-lab/mdi-export-profile

v2.0.21

Published

Shared export profile schema for MDI converters

Readme

@illusions-lab/mdi-export-profile

Typed JavaScript interface to MDI's Rust-owned export-profile contract. A profile controls presentation and metadata—page geometry, typography, page numbers, EPUB chapters, and publication-text options—without changing MDI syntax.

Install

npm install @illusions-lab/mdi-export-profile

Usage

import { parseExportProfileJson, resolveExportProfile } from "@illusions-lab/mdi-export-profile";

const profile = resolveExportProfile({
	layout: { system: "japanese-publisher" },
  metadata: { title: "A short work", language: "ja" },
  typesetting: {
    writingMode: "vertical",
    fontFamily: "Noto Serif JP",
    // Explicit line spacing belongs to typographic mode; strict keeps grid cells.
    fontSize: 11,
    lineSpacing: 1.5,
  },
  pagination: { gridMode: "typographic" },
});

const fromFile = parseExportProfileJson(
  '{"layout":{"system":"word"},"pagination":{"pageSize":"A5"}}'
);

Paper-size UI metadata

Japanese labels are part of the public catalogue, alongside stable keys and physical dimensions. listPageSizes() is suitable for a select menu.

import {
  getPageSizeLabel,
  listPageSizes,
  PAGE_SIZE_LABELS,
} from "@illusions-lab/mdi-export-profile";

getPageSizeLabel("Bunko"); // "文庫判"
PAGE_SIZE_LABELS.ja["JIS-B5"]; // "JIS B5判"
listPageSizes({ locale: "ja" });
// [{ key: "A4", label: "A4判", widthMm: 210, heightMm: 297 }, ...]

Use the resolved profile with the JavaScript export APIs, or pass a JSON profile to mdi build --config export.json. Validation, defaults, physical page dimensions, and renderer-facing values come from mdi-core; this package adds TypeScript types and Japanese UI labels without keeping a second layout table.

Configured exports must select layout.system. The two systems deliberately do not blend:

  • japanese-publisher is a strict manuscript grid. Horizontal text uses the four-six (Shirokuban) 10 pt Mincho 27 × 26 left-bound book default. Vertical text uses the A4-landscape, 10.5 pt Mincho 40 × 30 right-bound novel-manuscript default, with a 28 mm right binding margin. Both use mirrored pages.
  • word is a flowing Word-style document: A4 by default, 25.4 mm margins on all four edges, and no mirrored book gutter. It always uses gridMode: "typographic"; a strict character grid is rejected.

Other declared paper sizes derive safe values from the selected system. In a strict grid, lineSpacing is rejected; in typographic mode it is the renderer-owned baseline multiplier. Contest or house formats such as A4 40 × 30 belong in a separate application/preset layer, not in this generic schema or the MDI parser.

The strict character count is a full-width CJK manuscript grid. It fixes the printable inline extent, body cell pitch, and line pitch in DOCX/PDF; it does not falsely treat proportional Latin glyphs, ruby, or inline media as one fixed-width character each. Applications that need a submission-specific count should run their own source validation as well. The older fontSizePt and lineHeight spellings are accepted as aliases when reading existing JSON, but new profiles should use fontSize and lineSpacing.

Documentation