MCPcopy Index your code
hub / github.com/dolanmiu/docx

github.com/dolanmiu/docx @9.7.1 sqlite

repository ↗ · DeepWiki ↗ · release 9.7.1 ↗
1,239 symbols 3,303 edges 686 files 96 documented · 8% 12 cross-repo links
README
<img src="https://github.com/dolanmiu/docx/raw/9.7.1/logo/logo-animate.svg" width="100%" height="300" alt="clippy the assistant">







Easily generate and modify .docx files with JS/TS. Works for Node and on the Browser.

NPM version Downloads per month GitHub Action Workflow Status Known Vulnerabilities PRs Welcome codecov Docx.js Editor

<img src="https://i.imgur.com/QeL1HuU.png" alt="drawing"/>

Demo

Browser

Here are examples of docx being used with basic HTML/JS in a browser environment:

  • https://codepen.io/dolanmiu/pen/RwNeObg
  • https://jsfiddle.net/dolanmiu/onadx1gu/

Here are examples of docx working in Angular:

  • https://stackblitz.com/edit/angular-docx
  • https://stackblitz.com/edit/angular-wmd6k3

Here are examples of docx working in React:

  • https://stackblitz.com/edit/react-docx
  • https://stackblitz.com/edit/react-docx-images (adding images to Word Document)

Here is an example of docx working in Vue.js:

  • https://stackblitz.com/edit/vuejs-docx

Node

Press endpoint on the RunKit website:

RunKit Instructions

  • https://runkit.com/dolanmiu/docx-demo1 - Simple paragraph and text
  • https://runkit.com/dolanmiu/docx-demo2 - Advanced Paragraphs and text
  • https://runkit.com/dolanmiu/docx-demo3 - Bullet points
  • https://runkit.com/dolanmiu/docx-demo4 - Simple table
  • https://runkit.com/dolanmiu/docx-demo5 - Images
  • https://runkit.com/dolanmiu/docx-demo6 - Margins
  • https://runkit.com/dolanmiu/docx-demo7 - Landscape
  • https://runkit.com/dolanmiu/docx-demo8 - Header and Footer
  • https://runkit.com/dolanmiu/docx-demo10 - My CV generated with docx

More here

How to use & Documentation

Please refer to the documentation at https://docx.js.org/ for details on how to use this library, examples and much more!

Playground

Experience docx in action through Docx.js Editor, an interactive playground where you can code and preview the results in real-time.

Examples

Check the demo folder for examples.

Contributing

Read the contribution guidelines here.

Used by

drawing drawing drawing drawing drawing drawing drawing drawing drawing drawing drawing drawing drawing drawing drawing

...and many more!


patreon browserstack

Made with 💖

Extension points exported contracts — how you extend this code

IXmlableObject (Interface)
(no doc)
src/file/xml-components/xmlable-object.ts
Experience (Interface)
(no doc)
demo/10-my-cv.ts
StockPrice (Interface)
(no doc)
demo/79-table-from-data-source.ts
Education (Interface)
(no doc)
demo/10-my-cv.ts
Skill (Interface)
(no doc)
demo/10-my-cv.ts
Achievement (Interface)
(no doc)
demo/10-my-cv.ts

Core symbols most depended-on inside this repo

format
called by 811
src/export/formatter.ts
push
called by 412
src/file/document/body/body.ts
push
called by 182
src/file/paragraph/run/properties.ts
toBuffer
called by 94
src/export/packer/packer.ts
convertInchesToTwip
called by 55
src/util/convenience-functions.ts
push
called by 32
src/file/paragraph/properties.ts
createLsdException
called by 30
src/file/styles/sample/default-style.ts
createBorderElement
called by 26
src/file/border/border.ts

Shape

Class 664
Method 377
Function 190
Interface 6
Enum 2

Languages

TypeScript100%

Modules by API surface

src/file/styles/style/default-styles.ts51 symbols
src/file/paragraph/run/empty-children.ts51 symbols
src/file/file.ts26 symbols
src/file/paragraph/run/comment-run.ts25 symbols
src/file/xml-components/simple-elements.ts24 symbols
src/file/numbering/level.ts24 symbols
demo/10-my-cv.ts19 symbols
src/file/table/table-cell/table-cell-components.ts18 symbols
src/file/numbering/num.ts18 symbols
src/util/values.ts16 symbols
src/util/convenience-functions.ts12 symbols
src/file/xml-components/imported-xml-component.ts12 symbols

Dependencies from manifests, versioned

@microsoft/api-extractor7.58.7 · 1×
@types/inquirer9.0.3 · 1×
@types/node25.2.3 · 1×
@types/unzipper0.10.4 · 1×
@types/xml1.0.8 · 1×
@typescript-eslint/eslint-plugin8.8.1 · 1×
@vitest/coverage-v84.1.7 · 1×
@vitest/ui4.1.7 · 1×
cspell10.0.0 · 1×
docsify-cli4.3.0 · 1×
eslint9.13.0 · 1×

For agents

$ claude mcp add docx \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact