Easily generate and modify .docx files with JS/TS with a nice declarative API. Works for Node and on the Browser.
Installations
npm install docx
Developer Guide
Typescript
Yes
Module System
ESM
Min. Node Version
>=10
Node Version
20.18.1
NPM Version
10.8.2
Score
65.5
Supply Chain
98
Quality
85.6
Maintenance
100
Vulnerability
98.9
License
Releases
Contributors
Languages
TypeScript (100%)
Developer
Download Statistics
Total Downloads
17,324,454
Last Day
8,557
Last Week
120,755
Last Month
729,248
Last Year
7,206,235
GitHub Statistics
4,528 Stars
3,806 Commits
494 Forks
42 Watching
15 Branches
102 Contributors
Package Meta Information
Latest Version
9.1.0
Package Id
docx@9.1.0
Unpacked Size
2.98 MB
Size
591.63 kB
File Count
8
NPM Version
10.8.2
Node Version
20.18.1
Publised On
28 Nov 2024
Total Downloads
Cumulative downloads
Total Downloads
17,324,454
Last day
-76.2%
8,557
Compared to previous day
Last week
-32.6%
120,755
Compared to previous week
Last month
-3.3%
729,248
Compared to previous month
Last year
52.1%
7,206,235
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
38
Easily generate and modify .docx files with JS/TS. Works for Node and on the Browser.
Demo
Browser
Here are examples of docx
being used with basic HTML/JS
in a browser environment:
Here are examples of docx
working in Angular
:
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
:
Node
Press endpoint
on the RunKit
website:
- 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!
Examples
Check the demo folder for examples.
Contributing
Read the contribution guidelines here.
Used by
...and many more!
Made with 💖
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
30 commit(s) and 9 issue activity found in the last 90 days -- score normalized to 10
Reason
security policy file detected
Details
- Info: security policy file detected: SECURITY.md:1
- Info: Found linked content: SECURITY.md:1
- Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1
- Info: Found text in security policy: SECURITY.md:1
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
SAST tool is not run on all commits -- score normalized to 7
Details
- Warn: 21 commits out of 28 are checked with a SAST tool
Reason
dependency not pinned by hash detected -- score normalized to 6
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/default.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/dolanmiu/docx/default.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/default.yml:55: update your workflow using https://app.stepsecurity.io/secureworkflow/dolanmiu/docx/default.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/default.yml:65: update your workflow using https://app.stepsecurity.io/secureworkflow/dolanmiu/docx/default.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/default.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/dolanmiu/docx/default.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/default.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/dolanmiu/docx/default.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/default.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/dolanmiu/docx/default.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/default.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/dolanmiu/docx/default.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/demos.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/dolanmiu/docx/demos.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/github-pages.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/dolanmiu/docx/github-pages.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/github-pages.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/dolanmiu/docx/github-pages.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/github-pages.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/dolanmiu/docx/github-pages.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/github-pages.yml:35: update your workflow using https://app.stepsecurity.io/secureworkflow/dolanmiu/docx/github-pages.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/github-pages.yml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/dolanmiu/docx/github-pages.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm-publish.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/dolanmiu/docx/npm-publish.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm-publish.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/dolanmiu/docx/npm-publish.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm-publish.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/dolanmiu/docx/npm-publish.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm-publish.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/dolanmiu/docx/npm-publish.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm-publish.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/dolanmiu/docx/npm-publish.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm-publish.yml:39: update your workflow using https://app.stepsecurity.io/secureworkflow/dolanmiu/docx/npm-publish.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/remove-old-artifacts.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/dolanmiu/docx/remove-old-artifacts.yml/master?enable=pin
- Info: 0 out of 17 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 3 third-party GitHubAction dependencies pinned
- Info: 9 out of 9 npmCommand dependencies pinned
Reason
Found 7/12 approved changesets -- score normalized to 5
Reason
6 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97
- Warn: Project is vulnerable to: GHSA-4r62-v4vq-hr96
- Warn: Project is vulnerable to: GHSA-5v2h-r2cx-5xgj
- Warn: Project is vulnerable to: GHSA-rrrm-qjm4-v8hf
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/default.yml:1
- Warn: no topLevel permission defined: .github/workflows/demos.yml:1
- Warn: no topLevel permission defined: .github/workflows/github-pages.yml:1
- Warn: no topLevel permission defined: .github/workflows/npm-publish.yml:1
- Warn: no topLevel permission defined: .github/workflows/remove-old-artifacts.yml:1
- Info: no jobLevel write permissions found
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Score
6.3
/10
Last Scanned on 2024-12-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to docx
docx-preview
[![npm version](https://badge.fury.io/js/docx-preview.svg)](https://www.npmjs.com/package/docx-preview) [![Support Ukraine](https://img.shields.io/badge/Support-Ukraine-blue?style=flat&logo=adguard)](https://war.ukraine.ua/)
@vue-office/docx
支持多种文件(**docx、excel、pdf、pptx**)预览的vue组件库,支持vue2/3。也支持非Vue框架的预览。
@udecode/plate-serializer-docx
Docx serializer plugin for Plate
@js-preview/docx
支持多种文件(**docx、excel、pdf、pptx**)预览的vue组件库,支持vue2/3。也支持非Vue框架的预览。