@turbodocx/html-to-docx 1.13.5 → 1.15.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 +45 -6
- package/dist/html-to-docx.esm.js +1 -1
- package/dist/html-to-docx.umd.js +1 -1
- package/index.d.ts +1 -0
- package/package.json +12 -3
package/README.md
CHANGED
|
@@ -1,19 +1,32 @@
|
|
|
1
1
|
[](https://www.turbodocx.com)
|
|
2
2
|
|
|
3
|
-
html-to-docx
|
|
4
|
-
|
|
3
|
+
@turbodocx/html-to-docx
|
|
4
|
+
====================
|
|
5
5
|
[![NPM Version][npm-image]][npm-url]
|
|
6
|
+
[](https://github.com/turbodocx/html-to-docx)
|
|
6
7
|
[](https://typescript.org)
|
|
7
8
|
[](https://discord.gg/NYKwz4BcpX)
|
|
8
|
-
[](https://www.npmjs.com/package/@turbodocx/html-to-docx)
|
|
9
10
|
[](https://twitter.com/TurboDocx)
|
|
10
11
|
[](https://www.turbodocx.com/use-cases/embedded-api?utm_source=github&utm_medium=repo&utm_campaign=open_source)
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
Convert HTML to Word, Google Docs, and DOCX files with the fastest, most reliable JavaScript library available. Built for modern applications that demand speed and precision—from AI-powered document generation to enterprise reporting systems.
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
Based on the original work and assisted by the original contributors of [privateOmega/html-to-docx](https://github.com/privateOmega/html-to-docx), this library is now actively maintained and enhanced by TurboDocx, ensuring continuous improvements and long-term support for production environments.
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
## Why @turbodocx/html-to-docx?
|
|
18
|
+
|
|
19
|
+
🚀 **Lightning Fast Performance** - Pure JavaScript implementation with no dependencies on headless browsers or external binaries. Perfect for AI applications that need rapid document generation.
|
|
20
|
+
|
|
21
|
+
🔄 **Active Maintenance & Support** - Backed by TurboDocx with regular updates, bug fixes, and feature enhancements. Not another abandoned open-source project.
|
|
22
|
+
|
|
23
|
+
🤖 **AI-Ready Architecture** - Designed for modern AI workflows where speed matters. Generate thousands of documents without the overhead of browser automation.
|
|
24
|
+
|
|
25
|
+
⚡ **Zero External Dependencies** - No need for Puppeteer, Chrome, or LibreOffice. Pure Node.js implementation that works in any environment.
|
|
26
|
+
|
|
27
|
+
🎯 **Production Battle-Tested** - Used in production environments processing thousands of documents. Reliable, stable, and performant at scale.
|
|
28
|
+
|
|
29
|
+
🛠️ **Developer Experience** - Full TypeScript support, comprehensive documentation, and extensive examples to get you up and running in minutes.
|
|
17
30
|
|
|
18
31
|
## Installation
|
|
19
32
|
|
|
@@ -192,6 +205,7 @@ full fledged examples can be found under `example/`
|
|
|
192
205
|
- `defaultOrderedListStyleType` <?[String]> default ordered list style type. Defaults to `decimal`.
|
|
193
206
|
- `decodeUnicode` <?[Boolean]> flag to enable unicode decoding of header, body and footer. Defaults to `false`.
|
|
194
207
|
- `lang` <?[String]> language localization code for spell checker to work properly. Defaults to `en-US`.
|
|
208
|
+
- `direction` <?[String]> text direction for RTL (right-to-left) languages. Set to `'rtl'` for Arabic, Hebrew, etc. Defaults to `'ltr'`.
|
|
195
209
|
- `preProcessing` <?[Object]>
|
|
196
210
|
- `skipHTMLMinify` <?[Boolean]> flag to skip minification of HTML. Defaults to `false`.
|
|
197
211
|
- `footerHTMLString` <[String]> clean html string equivalent of footer. Defaults to `<p></p>` if footer flag is `true`.
|
|
@@ -227,6 +241,27 @@ Also you could add attribute `data-start="n"` to start the numbering from the n-
|
|
|
227
241
|
`<ol data-start="2">` will start the numbering from ( B. b. II. ii. 2. )
|
|
228
242
|
|
|
229
243
|
|
|
244
|
+
## RTL (Right-to-Left) Language Support
|
|
245
|
+
|
|
246
|
+
The library also supports RTL languages like Arabic and Hebrew. Use the `direction` option to enable RTL text flow:
|
|
247
|
+
|
|
248
|
+
```javascript
|
|
249
|
+
const htmlString = `
|
|
250
|
+
<h1>مرحبا بالعالم</h1>
|
|
251
|
+
<p>هذا نص تجريبي باللغة العربية ليظهر من اليمين إلى اليسار</p>
|
|
252
|
+
`;
|
|
253
|
+
|
|
254
|
+
const docx = await HTMLtoDOCX(htmlString, null, {
|
|
255
|
+
direction: 'rtl', // Enable RTL text direction
|
|
256
|
+
lang: 'ar-SA', // Arabic locale (or 'he-IL' for Hebrew)
|
|
257
|
+
font: 'Arial', // Use a font that supports RTL characters
|
|
258
|
+
});
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
For more RTL examples, check `example/react-example/src/example-rtl.js`.
|
|
262
|
+
|
|
263
|
+
## Font Compatibility
|
|
264
|
+
|
|
230
265
|
Font family doesnt work consistently for all word processor softwares
|
|
231
266
|
|
|
232
267
|
- Word Desktop work as intended
|
|
@@ -274,3 +309,7 @@ MIT
|
|
|
274
309
|
</a>
|
|
275
310
|
|
|
276
311
|
Made with [contrib.rocks](https://contrib.rocks).
|
|
312
|
+
|
|
313
|
+
---
|
|
314
|
+
|
|
315
|
+
**Note:** Currently optimized for Node.js environments. Browser support is planned for future releases.
|