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

@skhamzah123/compono-js

v0.4.0

Published

Agent-oriented, code-based PPTX/DOCX generation for TypeScript/JS — typed primitives, no raw coordinates.

Readme

@skhamzah123/compono-js

Agent-oriented, code-based PPTX/DOCX generation for TypeScript/JS. Describe a deck or document as typed primitives — an LLM agent never writes raw coordinates or touches OOXML.

A TypeScript port of compono's full pipeline — schema → resolver → validator → render, review(), Inspire, and DOCX generation — rendering pptx via pptxgenjs instead of python-pptx, and docx via docx instead of python-docx. Same primitive-JSON contracts as the Python package, same "validate → fix → render" feedback loop, independent implementation and independent version — for agent harnesses that write/call JS rather than Python. An MCP server is available separately as compono-js-mcp.

Why this exists: pptxgenjs produces higher-fidelity native .pptx output than python-pptx for equivalent content. compono's actual value isn't which library writes the XML — it's the constraint-based resolver (you describe intent, never raw x/y/w/h) plus the validate/render feedback loop. This package keeps that architecture and swaps the render backend.

Install

npm install @skhamzah123/compono-js

Quickstart

import { renderDeck } from "@skhamzah123/compono-js";

const spec = {
  slides: [
    {
      header: { title: "Q3 Results", subtitle: "Engineering team" },
      body: [
        {
          primitive: "text",
          mode: "bullets",
          content: ["Shipped the new layout resolver", "Cut render time by 40%"],
        },
      ],
    },
  ],
};

const report = await renderDeck(spec, "deck.pptx");
console.log(report.pptxPath, report.warnings);

Or from the command line:

npx --package=@skhamzah123/compono-js compono-js validate spec.json
npx --package=@skhamzah123/compono-js compono-js render spec.json -o deck.pptx --template modern

What's ported

pptx: full v1 primitive catalog (header, text, image, stat, grid, table, sequence, chart, shape including connector routing) — same resolver algorithm (flex-equal body stacking, 2D grid math, Liang-Barsky connector-routing with gutter-detour fallback), same overflow validator (real glyph advance widths via fontkit in place of fontTools), same structured error shape ({slide, primitive, field, error, detail, fix}).

review(): same 5 categories (contrast, whitespace, image_fit, font_size, style), same thresholds, via imageSize for real image dimensions instead of PIL.Image.open.

DOCX: same primitive catalog (heading, paragraph, bullet_list, numbered_list, table, image, chart, page_break) via the docx npm package. chart is the one documented exception — rasterized via chart.js/chartjs-node-canvas, same as Python's matplotlib approach (no JS library builds native Word charts either).

Inspire: scanDeck/aggregate/writeSkill, same grid-confidence scoring and per-deck (not per-shape) weighting. Since no npm package offers python-pptx's read-side object model, it reads the .pptx's OOXML directly (jszip + fast-xml-parser) — same content-stripping invariant (never reads literal run text or image bytes).

Not yet available: an MCP server bundled into this package — see the separate compono-js-mcp package instead.

Relationship to Python compono

Same contract (the primitive JSON a spec is made of), independent implementation, independently versioned. A spec written for one renders correctly through the other — that's the point. This package is not a wrapper or a subprocess call into Python; it's real TypeScript.