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

@office-open/core

v0.8.1

Published

Shared OOXML infrastructure — XML components, validators, converters, charts, and SmartArt

Readme

@office-open/core

npm version npm downloads npm license

Shared OOXML infrastructure — XML components, validators, converters, charts, SmartArt, and password hashing.

Features

  • XmlComponent Framework - Base classes for building OOXML element trees with dynamic namespace support
  • Value Validators - Runtime validation for OOXML spec types (ST_HexColor, ST_OnOff, ST_DecimalNumber, etc.)
  • Unit Converters - TWIP and EMU conversions (mm/in/pt/px)
  • Chart Components - Shared chart types (bar, line, pie, area, scatter) and chart collection for DOCX/PPTX
  • SmartArt Components - Data model, tree-to-model converter, collection, and built-in layout/style/color definitions
  • ID Generators - Sequential numeric IDs, nanoid, SHA-1 hash, UUID v4
  • OOXML Compliance - All types verified against ISO/IEC 29500-4 XSD schemas

Installation

# pnpm
pnpm add @office-open/core

# npm
npm install @office-open/core

# yarn
yarn add @office-open/core

# bun
bun add @office-open/core

Quick Start

import {
  OnOffElement,
  StringValueElement,
  BuilderElement,
  StringContainer,
  hexColorValue,
  decimalNumber,
  convertMillimetersToTwip,
  uniqueNumericIdCreator,
} from "@office-open/core";

// CT_OnOff — dynamic namespace prefix per XSD spec
new OnOffElement("w:b", false);
// → { "w:b": { _attr: { "w:val": false } } }

new OnOffElement("m:hideBot", false);
// → { "m:hideBot": { _attr: { "m:val": false } } }

// Builder with attributes + children
new BuilderElement({
  name: "w:r",
  attributes: { lang: { key: "xml:lang", value: "en-US" } },
  children: [new StringContainer("w:t", "Hello")],
});

// Value validators
hexColorValue("#FF0000"); // → "FF0000"
hexColorValue("auto"); // → "auto"
decimalNumber(10.7); // → 10

// Unit converters
convertMillimetersToTwip(25.4); // → 1440 (1 inch)
convertPixelsToEmu(100); // → 952500
convertInchesToEmu(1); // → 914400
convertPointsToEmu(12); // → 152400

// ID generators
const gen = uniqueNumericIdCreator();
gen(); // → 1, 2, 3, ...

OOXML Schema Compliance

| Type | XSD Reference | | -------------------- | ---------------------------------------------- | | ThemeColor | ST_ThemeColor (17 values) | | ThemeFont | ST_Theme (8 values) | | UniversalMeasure | ST_UniversalMeasure (mm, cm, in, pt, pc, pi) | | Percentage | ST_Percentage | | hexColorValue | ST_HexColor (auto + 3-byte hexBinary) | | OnOffElement | CT_OnOff (dynamic namespace prefix) | | HpsMeasureElement | CT_HpsMeasure | | StringValueElement | CT_String |

Exports

| Path | Contents | | ----------------------------- | --------------------------------------------------------------------- | | @office-open/core | XmlComponent, validators, converters, ID generators, password hashing | | @office-open/core/values | Validators + ThemeColor/ThemeFont only | | @office-open/core/chart | Chart types, series data, chart collection, title | | @office-open/core/smartart | SmartArt data model, tree-to-model, definitions | | @office-open/core/drawingml | DrawingML fills, outlines, effects, geometry, text body | | @office-open/core/patch | Template patching utilities (replacer, traverser, token replacer) | | @office-open/core/theme | Theme definitions and color schemes |

Benchmark

| Operation | hz | | ----------------------------- | ----- | | decimalNumber | ~21M | | hexColorValue (6-char hex) | ~13M | | uniqueNumericIdCreator | ~21M | | uniqueId (nanoid) | ~3.2M | | uniqueUuid | ~2.0M | | onOffObj (true) | ~19M | | onOffObj (false) | ~3.7M | | BuilderElement (attributes) | ~3.1M | | BuilderElement (children) | ~2.6M |

License