npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

n8n-nodes-docx

v0.2.0

Published

Convert documents (Word, Excel, Markdown, PDF) to/from each other. Includes an n8n community node and a reusable conversion library powered by LibreOffice headless.

Readme

n8n-nodes-docx

Convert documents between Word (DOCX), Excel (XLSX), Markdown (MD), PDF, HTML, CSV and plain text — as an n8n community node, and as a reusable Node.js library.

100% pure JavaScript — no LibreOffice, no system binaries, no setup. Works on any n8n instance (including managed/Docker hosts) the moment you install it.

Conversion matrix

| From \ To | PDF | DOCX | XLSX | CSV | MD | HTML | TXT | |-----------|:---:|:----:|:----:|:---:|:---:|:----:|:---:| | DOCX | ✅ | — | — | — | ✅ | ✅ | ✅ | | XLSX | ✅ | — | ✅ | ✅ | ✅ | ✅ | ✅ | | CSV | ✅ | — | ✅ | — | ✅ | ✅ | ✅ | | MD | ✅ | ✅ | — | — | — | ✅ | ✅ | | HTML | ✅ | ✅ | — | — | ✅ | — | ✅ | | PDF | — | ⚠️ | ⚠️ | ⚠️ | ⚠️ | ⚠️ | ✅ |

✅ supported · ⚠️ best-effort (text-layer extraction; layout/images not preserved) · — not meaningful

Fidelity notes

Pure-JS conversion favours content and structure (text, headings, lists, tables, bold/italic) over pixel-perfect layout. Complex page layouts, embedded fonts and images are simplified. For most Word/Excel/Markdown/PDF automation this is exactly what you want; if you need print-perfect fidelity, a LibreOffice-backed service is the alternative.

Requirements

  • Node.js ≥ 18.10

That's it. All conversion libraries ship inside the package.

Install (n8n)

In n8n: Settings → Community Nodes → Install, enter n8n-nodes-docx.

Or manually:

cd ~/.n8n/nodes        # or your N8N_CUSTOM_EXTENSIONS dir
npm install n8n-nodes-docx

Add a DocX Convert node, pick Source Format (or Auto-Detect) and Target Format, and point it at the binary property holding your file (default data).

Use as a library

import { convert } from 'n8n-nodes-docx';
import { readFile, writeFile } from 'node:fs/promises';

const docx = await readFile('report.docx');
const { data, ext, mime } = await convert(docx, { from: 'docx', to: 'pdf' });
await writeFile(`report.${ext}`, data);

// Markdown → Word
const pdf = await convert('# Hello\n\nWorld', { from: 'md', to: 'docx' });

// Auto-detect from filename
await convert(buf, { to: 'md', filename: 'sheet.xlsx' });

API

convert(input: Buffer | string, opts: {
  from?: 'docx'|'xlsx'|'md'|'pdf'|'html'|'txt'|'csv'; // auto-detected if omitted
  to:    'docx'|'xlsx'|'md'|'pdf'|'html'|'txt'|'csv';
  filename?: string;     // helps auto-detection
}): Promise<{ data: Buffer; mime: string; ext: Format }>

Development

npm install
npm run build      # tsc → dist/
npm test           # node --test (real conversions, no system deps)
npm run dev        # tsc --watch

Project layout:

src/                 reusable conversion library
  convert.ts         routing / orchestration
  readers.ts         docx/xlsx/pdf/html → normalized form
  writers.ts         → pdf (pdfkit), docx, xlsx, csv, md, html
  html-model.ts      HTML → structured blocks (shared by pdf/docx writers)
  markdown.ts        md ↔ html (marked / turndown)
  formats.ts         format detection + MIME
nodes/Docx/          n8n community node + icon
test/                conversion tests

Powered by: pdfkit, docx, xlsx (SheetJS), mammoth, pdf-parse, marked, turndown, html-to-text — all pure JS.

License

MIT