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 🙏

© 2025 – Pkg Stats / Ryan Hefner

node-red-contrib-html-to-docx

v1.0.2

Published

The HTML to DOCX node converts HTML content to a DOCX file for node-red.

Downloads

19

Readme

HTML to DOCX Node

The HTML to DOCX node converts HTML content to a DOCX file for node-red.

Installation

To install the package, run the following command in your Node-RED user directory (typically ~/.node-red):

npm install node-red-contrib-html-to-docx

Usage

The HTML to DOCX node takes an HTML input and converts it to a DOCX output file. The output file name is specified using the filename property. In the example above, the output file is saved as "output.docx" and specified as a "file".

Functionality

The function of this node is to convert the msg.payload content to a DOCX file and output it by saving it to the msg.payload property. Additionally, if the output property of the node is set to "Buffer", it returns a buffer instead of setting msg.payload.

Properties

  • filename: Specifies the name of the DOCX file to be saved.
  • output: Specifies the output type. It can take the values "Buffer" or "file".

Examples

The following example uses an inject node to send HTML content directly to the html2docx node and displays the output through a debug node.

[{"id":"1eb5ec7d.4a9a8a","type":"inject","z":"73a31b55.9b0484","name":"","topic":"","payload":"<html><head><title>Test Page</title></head><body><h1>Hello, world!</h1></body></html>","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":190,"y":300,"wires":[["6e6672d9.75c7f"]]},{"id":"6e6672d9.75c7f","type":"html2docx","z":"73a31b55.9b0484","name":"","filename":"output.docx","output":"Buffer","x":430,"y":300,"wires":[["c1d6d956.6b9aa"]]},{"id":"c1d6d956.6b9aa","type":"debug","z":"73a31b55.9b0484","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":670,"y":300,"wires":[]}]

In this example, the inject node sends the HTML content directly to the html2docx node. The html2docx node converts the incoming HTML content to a DOCX file and sends the resulting buffer in the msg.payload property to the debug node.

Error Handling

This node returns an error message when the HTML content cannot be converted. The error message can be retrieved using the error property added to the node's output.