
Security News
US Government Forces Anthropic to Pull Claude Fable Days After Launch
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.
@office-open/docx
Advanced tools
Easily generate .docx files with JS/TS with a nice declarative API. Works for Node and on the Browser.
Easily generate .docx files with JS/TS with a nice declarative API. Works for Node and on the Browser.
# Install with npm
$ npm install @office-open/docx
# Install with pnpm
$ pnpm add @office-open/docx
import { Document, Paragraph, TextRun, Packer } from "@office-open/docx";
import { writeFileSync } from "node:fs";
const doc = new Document({
sections: [
{
children: [
new Paragraph({
children: [
new TextRun("Hello World"),
new TextRun({
text: " - Bold text",
bold: true,
}),
],
}),
],
},
],
});
const buffer = await Packer.toBuffer(doc);
writeFileSync("My Document.docx", buffer);
Check the demo folder for 100+ working examples covering every feature.
Performance comparison against original docx (9.6.1) package (higher ops/s is better, Windows 11 / Node 24).
DEFLATE = compressed (default), STORE = no compression. Both libraries use DEFLATE.
Create + toBuffer (end-to-end)
| Scenario | DEFLATE sync | STORE sync | DEFLATE async | STORE async | docx |
|---|---|---|---|---|---|
| Simple (2 paragraphs) | 349 ops/s | 2,085 ops/s | 379 ops/s | 2,495 ops/s | 192 ops/s |
| Styled paragraphs (20) | 477 ops/s | 1,983 ops/s | 511 ops/s | 1,918 ops/s | 236 ops/s |
| Table (10×5) | 448 ops/s | 1,505 ops/s | 480 ops/s | 1,565 ops/s | 203 ops/s |
| Full featured (header/footer/headings/table/paragraphs) | 326 ops/s | 992 ops/s | 380 ops/s | 1,100 ops/s | 163 ops/s |
Large Files — Create + toBuffer
| Scenario | DEFLATE sync | STORE sync | DEFLATE async | STORE async | docx |
|---|---|---|---|---|---|
| 2000 paragraphs | 43.6 ops/s | 53.4 ops/s | 17.7 ops/s | 53.8 ops/s | 20.0 ops/s |
| 200×10 table | 78.0 ops/s | 106.6 ops/s | 24.1 ops/s | 109.6 ops/s | 30.0 ops/s |
| 20 sections × 100 paragraphs | 44.0 ops/s | 70.9 ops/s | 21.6 ops/s | 75.9 ops/s | 22.9 ops/s |
Large File (~100MB) — Mixed Content
2000 paragraphs + 200 unique images (500KB each) + 100×10 table. Speedup is vs docx.
| Method | Speed | Speedup |
|---|---|---|
| DEFLATE sync | 0.37 ops/s | 1.8x |
| STORE sync | 0.37 ops/s | 1.7x |
| DEFLATE async | 0.41 ops/s | 2.0x |
| STORE async | 0.42 ops/s | 2.0x |
| docx | 0.21 ops/s |
FAQs
Generate, parse, and patch .docx documents with a declarative TypeScript API
The npm package @office-open/docx receives a total of 142 weekly downloads. As such, @office-open/docx popularity was classified as not popular.
We found that @office-open/docx 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.

Security News
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.

Security News
A network of 152 Chrome live wallpaper extensions hid ad tracking and made extension-driven traffic look like Google search clicks.

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