docx-plus 0.1.6 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,13 +1,14 @@
1
1
  # docx-plus
2
2
 
3
- [![NPM version][npm-image]][npm-url]
4
- [![Downloads per month][downloads-image]][downloads-url]
5
- [![GitHub Action Workflow Status][github-actions-workflow-image]][github-actions-workflow-url]
6
- [![PRs Welcome][pr-image]][pr-url]
3
+ ![npm version](https://img.shields.io/npm/v/docx-plus)
4
+ ![npm downloads](https://img.shields.io/npm/dw/docx-plus)
5
+ ![npm license](https://img.shields.io/npm/l/docx-plus)
7
6
 
8
- Easily generate and modify .docx files with JS/TS. Works for Node and on the Browser.
7
+ Easily generate and modify .docx files with JS/TS. Works for Node.js and on the Browser.
9
8
 
10
- **docx-plus** is an enhanced fork of [docx](https://github.com/dolanmiu/docx) — a TypeScript/JavaScript library for generating and modifying Word documents (.docx) programmatically with a declarative API.
9
+ **docx-plus** is an enhanced fork of [docx](https://github.com/dolanmiu/docx) by Dolan Miu — a TypeScript/JavaScript library for generating and modifying Word documents (.docx) programmatically with a declarative API. We extend our sincere gratitude to the original author and all contributors for their foundational work.
10
+
11
+ This package re-exports everything from `@office-open/docx` for backward compatibility. If you are starting a new project, we recommend using `@office-open/docx` directly.
11
12
 
12
13
  ## What's Different from docx?
13
14
 
@@ -46,40 +47,36 @@ Easily generate and modify .docx files with JS/TS. Works for Node and on the Bro
46
47
  | Math advanced | Basic math only | **Complete** (box, borderBox, eqArr, groupChr, matrix, phant, accent, fraction, nAry, func, delim, bar, limLow, limUpp, sPre, sSub, sSup) |
47
48
  | Group Shape | Basic (transform only) | **Enhanced** (fill, effects, `chOff`/`chExt` child coordinates) |
48
49
  | Test environment | jsdom | happy-dom |
49
- | OOXML compliance | ECMA-376 (legacy) | **ISO/IEC 29500-4** (latest) — comprehensive WordprocessingML, DrawingML, and Shared Math coverage; see scope notes below |
50
+ | OOXML compliance | ECMA-376 (legacy) | **ISO/IEC 29500-4** (latest) — comprehensive WordprocessingML, DrawingML, and Shared Math coverage |
50
51
 
51
52
  ## OOXML Coverage
52
53
 
53
54
  **docx-plus** provides comprehensive coverage of the WordprocessingML, DrawingML, and Shared Math specifications within ISO/IEC 29500-4. This includes:
54
55
 
55
56
  - **WordprocessingML**: paragraphs, runs, tables (full row/cell/table properties), sections, headers/footers, footnotes/endnotes, table of contents, numbering/lists, styles, bookmarks, hyperlinks, SDT content controls, form fields, track changes, comments, bibliography sources, math equations, ruby annotations, and more
56
- - **DrawingML**: shapes, images, text bodies, colors (all 6 color types + 29 transforms), fills (solid, gradient, pattern, group), outlines, effects (28 types with recursive containers), 3D scenes, custom geometry, and image adjustments
57
+ - **DrawingML**: shapes, images, text bodies, colors (all 6 color types + 29 transforms), fills (solid, gradient, pattern, group), outlines, effects (28 types with recursive containers), 3D scenes, custom geometry, image adjustments, **charts** (bar, column, line, pie, area, scatter), and **SmartArt** diagrams (process, hierarchy, cycle, pyramid, list)
57
58
  - **Shared Math**: all equation structures (fraction, radical, n-ary, integrals, matrices, accents, delimiters, etc.)
58
59
 
59
60
  **Not in scope** (separate OOXML domains with their own dedicated specifications):
60
61
 
61
- - **SmartArt** (`dgm:`) — graphical diagram engine
62
- - **Charts** (`c:`) — native OOXML charting (typically handled by charting libraries)
63
62
  - **Mail Merge** — field codes are supported, but external data source connections are not
64
63
  - **Cover Pages** — `docPartObj` SDT is supported, but Building Blocks part references require template files
65
64
 
66
65
  ## Installation
67
66
 
68
- ```terminal
69
- npm install --save docx-plus
70
- ```
67
+ ```bash
68
+ # Install with npm
69
+ $ npm install docx-plus
71
70
 
72
- ```ts
73
- import * as docx from "docx-plus";
74
- // or
75
- import { Document, Packer, Paragraph, TextRun } from "docx-plus";
71
+ # Install with pnpm
72
+ $ pnpm add docx-plus
76
73
  ```
77
74
 
78
- ## Quick Example
75
+ ## Quick Start
79
76
 
80
- ```ts
81
- import * as fs from "fs";
82
- import { Document, Packer, Paragraph, TextRun } from "docx-plus";
77
+ ```typescript
78
+ import { Document, Paragraph, TextRun, Packer } from "docx-plus";
79
+ import { writeFileSync } from "node:fs";
83
80
 
84
81
  const doc = new Document({
85
82
  sections: [
@@ -100,28 +97,13 @@ const doc = new Document({
100
97
  });
101
98
 
102
99
  const buffer = await Packer.toBuffer(doc);
103
- fs.writeFileSync("My Document.docx", buffer);
100
+ writeFileSync("My Document.docx", buffer);
104
101
  ```
105
102
 
106
- ## Documentation
107
-
108
- Please refer to the [documentation](https://github.com/DemoMacro/docx-plus#readme) for details on how to use this library, examples and much more!
109
-
110
103
  ## Examples
111
104
 
112
- Check the [demo folder](https://github.com/DemoMacro/docx-plus/tree/master/demo) for 110+ working examples covering every feature.
113
-
114
- ## Contributing
115
-
116
- Contributions are welcome! Please feel free to submit pull requests.
105
+ Check the [demo folder](../docx/demo) for 100+ working examples covering every feature.
117
106
 
118
- ---
107
+ ## License
119
108
 
120
- [npm-image]: https://badge.fury.io/js/docx-plus.svg
121
- [npm-url]: https://npmjs.org/package/docx-plus
122
- [downloads-image]: https://img.shields.io/npm/dm/docx-plus.svg
123
- [downloads-url]: https://npmjs.org/package/docx-plus
124
- [github-actions-workflow-image]: https://github.com/DemoMacro/docx-plus/workflows/Default/badge.svg?branch=main
125
- [github-actions-workflow-url]: https://github.com/DemoMacro/docx-plus/actions
126
- [pr-image]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg
127
- [pr-url]: http://makeapullrequest.com
109
+ - [MIT](LICENSE) © [Demo Macro](https://imst.xyz/)