
Company News
Andrew Becherer Joins Socket as Chief Information Security Officer
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.
@office-open/core
Advanced tools
Shared OOXML infrastructure: XmlComponent, value validators, unit converters
Shared OOXML infrastructure: XmlComponent, value validators, unit converters, chart types, and SmartArt definitions.
# Install with npm
$ npm install @office-open/core
# Install with pnpm
$ pnpm add @office-open/core
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, ...
| 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 |
| Path | Contents |
|---|---|
@office-open/core | XmlComponent, validators, converters, ID generators |
@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 |
| Operation | hz |
|---|---|
decimalNumber | ~18M |
hexColorValue (6-char hex) | ~11M |
uniqueNumericIdCreator | ~18M |
uniqueId (nanoid) | ~3.0M |
uniqueUuid | ~1.7M |
onOffObj (true) | ~16M |
onOffObj (false) | ~3.5M |
BuilderElement (attributes) | ~4.9M |
BuilderElement (children) | ~3.6M |
FAQs
Shared OOXML infrastructure — XML components, validators, converters, charts, and SmartArt
The npm package @office-open/core receives a total of 503 weekly downloads. As such, @office-open/core popularity was classified as not popular.
We found that @office-open/core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.

Company News
Replit is integrating Socket Firewall into its AI-powered development experience to help protect builders from malicious open source packages.

Security News
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.