Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@office-open/docx

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@office-open/docx - npm Package Compare versions

Comparing version
0.6.5
to
0.6.6
+29
dist/chunk-DJOrGtkp.js
//#region \0rolldown/runtime.js
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
var __exportAll = (all, no_symbols) => {
let target = {};
for (var name in all) __defProp(target, name, {
get: all[name],
enumerable: true
});
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
return target;
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
key = keys[i];
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
get: ((k) => from[k]).bind(null, key),
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
});
}
return to;
};
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
//#endregion
export { __toCommonJS as i, __exportAll as n, __reExport as r, __esmMin as t };

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

+8
-8
{
"name": "@office-open/docx",
"version": "0.6.5",
"version": "0.6.6",
"description": "Easily generate .docx files with JS/TS with a nice declarative API. Works for Node and on the Browser.",

@@ -35,8 +35,8 @@ "keywords": [

"type": "module",
"main": "dist/index.mjs",
"types": "dist/index.d.mts",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.mts",
"import": "./dist/index.mjs"
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
}

@@ -46,4 +46,4 @@ },

"undio": "0.2.0",
"@office-open/core": "0.6.5",
"@office-open/xml": "0.6.5"
"@office-open/core": "0.6.6",
"@office-open/xml": "0.6.6"
},

@@ -53,3 +53,3 @@ "scripts": {

"build": "vp pack",
"test": "vp test run --coverage",
"test": "vp test run",
"check": "vp check --fix",

@@ -56,0 +56,0 @@ "typedoc": "typedoc src/index.ts --tsconfig tsconfig.typedoc.json",

+43
-50

@@ -11,25 +11,25 @@ # @office-open/docx

- **Document Generation** - Create Word documents with sections, headers, footers, and page numbers
- **Paragraphs & Text** - Rich text support with bold, italic, underline, strikethrough, and more
- **Tables** - Full table support with merged cells, borders, and styles
- **Images** - Inline and floating images with sizing, positioning, and wrapping
- **Hyperlinks** - External and internal hyperlinks with custom styling
- **Headers & Footers** - First, last, even/odd page headers and footers
- **Lists** - Numbered and bulleted lists with multiple levels and custom formats
- **Styles** - Paragraph, character, and table styles with inheritance
- **Table of Contents** - Auto-generated table of contents with custom styling
- **Footnotes & Endnotes** - Comprehensive footnote and endnote support
- **Charts** - Bar, line, pie, area, and scatter charts with customization
- **Math Equations** - Full mathematical equation support via MathML
- **SmartArt** - Built-in SmartArt graphic generation
- **Bibliography** - Source management and citation support
- **Comments** - Document comments with author and date tracking
- **Track Revisions** - Insertions, deletions, and formatting changes
- **Content Controls** - Structured document tags (SDT) for form-like documents
- **Text Boxes** - Floating text boxes with content and styling
- **Checkboxes** - Form checkbox support in documents
- **DrawingML** - Shapes with fills, shadows, effects, and transformations
- **Custom Fonts** - Font embedding and custom font tables
- **Template Patching** - Patch existing DOCX templates via placeholder replacement
- **Settings** - Comprehensive document settings and compatibility options
- 📄 **Document Generation** — Create Word documents with sections, headers, footers, and page numbers
- ✍️ **Paragraphs & Text** — Rich text support with bold, italic, underline, strikethrough, and more
- 📊 **Tables** — Full table support with merged cells, borders, and styles
- 🖼️ **Images** — Inline and floating images with sizing, positioning, and wrapping
- 🔗 **Hyperlinks** — External and internal hyperlinks with custom styling
- 📑 **Headers & Footers** — First, last, even/odd page headers and footers
- 📋 **Lists** — Numbered and bulleted lists with multiple levels and custom formats
- 🎨 **Styles** — Paragraph, character, and table styles with inheritance
- 📖 **Table of Contents** — Auto-generated table of contents with custom styling
- 📝 **Footnotes & Endnotes** — Comprehensive footnote and endnote support
- 📈 **Charts** — Bar, line, pie, area, and scatter charts with customization
- 🔢 **Math Equations** — Full mathematical equation support via MathML
- 🧩 **SmartArt** — Built-in SmartArt graphic generation
- 📚 **Bibliography** — Source management and citation support
- 💬 **Comments** — Document comments with author and date tracking
- 📝 **Track Revisions** — Insertions, deletions, and formatting changes
- 📋 **Content Controls** — Structured document tags (SDT) for form-like documents
- 📦 **Text Boxes** — Floating text boxes with content and styling
- ☑️ **Checkboxes** — Form checkbox support in documents
- 🖌️ **DrawingML** — Shapes with fills, shadows, effects, and transformations
- 🔤 **Custom Fonts** — Font embedding and custom font tables
- 🔧 **Template Patching** — Patch existing DOCX templates via placeholder replacement
- ⚙️ **Settings** — Comprehensive document settings and compatibility options

@@ -80,31 +80,22 @@ ## Installation

Performance comparison against original `docx` (9.6.1) package (Windows 11 / Node 22):
Performance comparison against original `docx` (9.6.1) package (higher ops/s is better, Windows 11 / Node 24).
**Object Creation (no pack)**
DEFLATE = compressed (default), STORE = no compression. Both libraries use DEFLATE.
| Scenario | @office-open/docx | docx | Speedup |
| ------------------------------------------------------- | ----------------: | ---------: | -------: |
| Simple document (2 paragraphs) | 20.0K ops/s | 6.2K ops/s | **3.2x** |
| Styled paragraphs (20 paragraphs) | 11.4K ops/s | 4.6K ops/s | **2.5x** |
| Table (10x5 cells) | 10.1K ops/s | 3.7K ops/s | **2.7x** |
| Full featured (header/footer/headings/table/paragraphs) | 5.5K ops/s | 2.8K ops/s | **2.0x** |
**Create + toBuffer (end-to-end)**
Both libraries use DEFLATE compression.
| Scenario | DEFLATE sync | STORE sync | DEFLATE async | STORE async | docx |
| ------------------------------------------------------- | -----------: | ----------: | ------------: | ----------: | --------: |
| Simple (2 paragraphs) | 395 ops/s | 3,024 ops/s | 414 ops/s | 3,078 ops/s | 201 ops/s |
| Styled paragraphs (20) | 597 ops/s | 2,315 ops/s | 604 ops/s | 2,453 ops/s | 247 ops/s |
| Table (10×5) | 460 ops/s | 1,984 ops/s | 597 ops/s | 1,961 ops/s | 212 ops/s |
| Full featured (header/footer/headings/table/paragraphs) | 381 ops/s | 1,294 ops/s | 418 ops/s | 1,324 ops/s | 193 ops/s |
| Scenario | @office-open/docx | docx | Speedup |
| ------------------------------------------------------- | ----------------: | --------: | -------: |
| Simple document (2 paragraphs) | 388 ops/s | 194 ops/s | **2.0x** |
| Styled paragraphs (20 paragraphs) | 402 ops/s | 232 ops/s | **1.7x** |
| Table (10x5 cells) | 463 ops/s | 238 ops/s | **1.9x** |
| Full featured (header/footer/headings/table/paragraphs) | 346 ops/s | 179 ops/s | **1.9x** |
**Large Files — Create + toBuffer**
| Scenario | @office-open/docx | docx | Speedup |
| ---------------------------- | ----------------: | ---------: | -------: |
| 2000 paragraphs | 42.2 ops/s | 27.7 ops/s | **1.5x** |
| 200×10 table | 77.4 ops/s | 37.3 ops/s | **2.1x** |
| 20 sections × 100 paragraphs | 47.0 ops/s | 30.9 ops/s | **1.5x** |
| Scenario | DEFLATE sync | STORE sync | DEFLATE async | STORE async | docx |
| ---------------------------- | -----------: | ----------: | ------------: | ----------: | ---------: |
| 2000 paragraphs | 49.0 ops/s | 67.4 ops/s | 20.8 ops/s | 66.6 ops/s | 26.2 ops/s |
| 200×10 table | 90.1 ops/s | 129.1 ops/s | 25.5 ops/s | 125.5 ops/s | 37.0 ops/s |
| 20 sections × 100 paragraphs | 47.4 ops/s | 83.4 ops/s | 23.3 ops/s | 85.7 ops/s | 28.0 ops/s |

@@ -115,7 +106,9 @@ **Large File (~100MB) — Mixed Content**

| Method | Speed | Speedup |
| ------------------------- | ---------: | -------: |
| @office-open/docx (sync) | 0.36 ops/s | 1.2x |
| @office-open/docx (async) | 0.40 ops/s | **1.3x** |
| docx | 0.30 ops/s | |
| Method | Speed | Speedup |
| ------------- | ---------: | -------: |
| DEFLATE sync | 0.35 ops/s | **1.2x** |
| STORE sync | 0.36 ops/s | **1.2x** |
| DEFLATE async | 0.40 ops/s | **1.3x** |
| STORE async | 0.39 ops/s | **1.3x** |
| docx | 0.30 ops/s | |

@@ -122,0 +115,0 @@ ## License

//#region \0rolldown/runtime.js
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
var __exportAll = (all, no_symbols) => {
let target = {};
for (var name in all) __defProp(target, name, {
get: all[name],
enumerable: true
});
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
return target;
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
key = keys[i];
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
get: ((k) => from[k]).bind(null, key),
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
});
}
return to;
};
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
//#endregion
export { __toCommonJS as i, __exportAll as n, __reExport as r, __esmMin as t };

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display