NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #2883 most downloaded on npm
Advanced html to plain text converter
Last release 1 months ago
19 Aug 2026
Ships unpredictably
gaps range from 2 weeks to 3.1 years
Nearly every release is documented
notes for 22 of 24 stable releases
33 versions withdrawn
withdrawn after publishing
14 years old
57 releases · first in 2012
This addresses a security vulnerability in deepmerge-ts dependency - recommended to update from html-to-text 10.0.0. Older versions of html-to-text do…
All commits: 10.0.0...10.0.1
This addresses a security vulnerability in deepmerge-ts dependency - recommended to update from html-to-text 10.0.0. Older versions of html-to-text don't have this dependency.
deepmerge-ts updated from 7.1.5 to 8.0.1 (release notes, changelog)Requirement changes and minor behavior changes from upstream dependencies are the main source of breaking changes here.
One column per quarter.
All commits: 9.0.5...10.0.0
This is mostly a maintenance release - to bring it up to date with current ecosystem and resolve some compatibility issues.
selderee updated from 0.11.0 to 0.12.0 (changelog) and parseley - from 0.12.0 to 0.13.1 (changelog)
:empty, :first-child, :last-child, :only-child and :any-link pseudo-classes support;htmlparser2 updated from 8.0.2 to 10.1.0 (release notes)
textarea and xmp tags;deepmerge with deepmerge-ts;
htmlparser2 are ESM-only, so html-to-text v11 will follow suit;package.json exports;selderee updated from 0.10.0 to 0.11.0 (changelog) and parseley - from 0.11.0 to 0.12.0 (changelog)
selderee updated from 0.10.0 to 0.11.0 (changelog) and parseley - from 0.11.0 to 0.12.0 (changelog)
htmlparser2 updated from 8.0.1 to 8.0.2 (release notes)
deepmerge updated from 4.3.0 to 4.3.1 - no functional changes;All commits: 9.0.4...9.0.5
fixed: dataTable formatter was missing some existing cells in incompletely defined tables: #282;
dataTable formatter was missing some existing cells in incompletely defined tables: #282;All commits: 9.0.3...9.0.4
document the usage of metadata object;
dom-serializer dependency: #269.All commits: 9.0.2...9.0.3
support multi-character code points in encodeCharacters option: #267.
encodeCharacters option: #267.All commits: 9.0.1...9.0.2
fixed a broken link in readme: #262;
BlockTextBuilder.closeTable: #264;BlockTextBuilder.closeTable.All commits: 9.0.0...9.0.1
Breaking change for those who dare to write their own table formatter (in case there is anyone) - closeTable function got a required property in the o…
All commits: 8.2.1...9.0.0
Version 9 roadmap: #240
Request for comments: #261 [RFC] Naming issue - please take a look and share opinions while you're here
Required Node version is now >=14.
Package now provides cjs and mjs exports.
If you use CLI then install that package instead.
The new package uses new arg parser aspargvs instead of minimist in order to deal with the vast options space of html-to-text.
htmlparser2 updated from 6.1.0 to 8.0.1 (Release notes);he dependency is removed. It was needed at the time it was introduced, apparently, but at this point htmlparser2 seems to do a better job itself.decodeOptions section removed with he dependency;fromString method removed;BlockTextBuilder methods are now removed.Refer to README for migration instructions.
decodeEntities - controls whether HTML entities found in the input HTML should be decoded or left as is in the output text;encodeCharacters - a dictionary with characters that should be replaced in the output text and corresponding escape sequences.New generic formatters blockString, blockTag, blockHtml, inlineString, inlineSurround, inlineTag, inlineHtml cover some common usage scenarios such as #231.
anchor and image got pathRewrite option;dataTable formatter allows zero colSpacing.openList, openListItem, closeListItem, closeList). Addresses #238;startNoWrap, stopNoWrap - allows to keep local inline content in a single line regardless of wrapping options;addLiteral - it is like addInline but circumvents most of the text processing logic. This should be preferred when inserting markup elements;builder.metadata. This allows to compile the converter once and still being able to supply per-document data. Metadata object is supplied as the last optional argument to convert function and the function returned by compile function;closeTable function got a required property in the options object - tableToString function, and previously existed colSpacing and rowSpacing are removed (now a responsibility of the tableToString function).tags option support. Addresses #253.Nothing published for this version
Nothing published for this version
No changes in published package. Bumped dev dependencies and regenerated package-lock.json.
No changes in published package. Bumped dev dependencies and regenerated package-lock.json.
Fix for the issue #249 and possibly other obscure issues when some selector options are ignored. options.selectors array was not fully processed befor
Fix for the issue #249 and possibly other obscure issues when some selector options are ignored. options.selectors array was not fully processed before.
Bump minimist dependency, regenerate package-lock.json.
Bump minimist dependency, regenerate package-lock.json.
noLinkBrackets formatters option is now deprecated.
preserveNewlines option is used. Addresses #232;linkBrackets option - it accepts an array of two strings (default: ['[', ']']) or false to remove the brackets. Addresses #236;noLinkBrackets formatters option is now deprecated.All commits: 8.0.0...8.1.0
BREAKING CHANGE: All outermost elements matching provided selectors will be present in the output (previously it was only the first match for each sel…
All commits: 7.1.1...8.0.0
Version 8 roadmap issue: #228
The main focus of this version. Addresses the most demanded user requests (#159, #179, partially #143).
It is now possible to specify formatting options or assign custom formatters not only by tag names but by almost any selectors.
See the README Selectors section for details.
Note: The new selectors option is an array, in contrast to the tags option introduced in version 6 (and now deprecated). Selectors have to have a well defined order and object properties is not a right tool for that.
Two new packages were created to enable this feature - parseley and selderee.
The same selectors implementation is used now to narrow down the conversion to specific HTML DOM fragments. Addresses #96. (Previous implementation had more limited selectors format.)
BREAKING CHANGE: All outermost elements matching provided selectors will be present in the output (previously it was only the first match for each selector). Addresses #215.
limits.maxBaseElements can be used when you only need a fixed number of base elements and would like to avoid checking the rest of the source HTML document.
Base elements can be arranged in output text in the order of matched selectors (default, to keep it closer to the old implementation) or in the order of appearance in source HTML document.
BREAKING CHANGE: previous implementation was treating id selectors in the same way as class selectors (could match <foo id="a b"> with foo#a selector). New implementation is closer to the spec and doesn't expect multiple ids on an element. You can achieve the old behavior with foo[id~=a] selector in case you rely on it for some poorly formatted documents (note that it has different specificity though).
Since options preprocessing is getting more involved with selectors compilation, it seemed reasonable to break the single htmlToText() function into compilation and convertation steps. It might provide some performance benefits in client code.
compile(options) returns a function of a single argument (html string);htmlToText(html, options) is now an alias to convert(html, options) function and works as before.baseElement;returnDomByDefault;tables;tags.Refer to README for migration instructions.
No previously deprecated stuff is removed in this version. Significant cleanup is planned for version 9 instead.
Nothing published for this version
Bump minimist dependency and dev dependencies, regenerate package-lock.json.
Bump minimist dependency and dev dependencies, regenerate package-lock.json.
Regenerate package-lock.json.
Regenerate package-lock.json.
htmlparser2 updated from 6.0.0 to 6.1.0 (Release notes);
htmlparser2 updated from 6.0.0 to 6.1.0 (Release notes);Positional arguments introduced in version 6.0.0 are now deprecated. Formatters written for the version 6.0.0 should keep working for now but the comp…
Required Node version is now >=10.23.2.
lodash dependency is removed;htmlparser2 updated from 4.1.0 to 6.0.0 (Release notes, also domhandler). There is a slim chance you can run into some differences in case you're relying on it heavily in your custom formatters;BlockTextBuilder methods now accept option objects for optional arguments. This improves client code readability and allows to introduce extra options with ease. It will see some use in future updates.
Positional arguments introduced in version 6.0.0 are now deprecated. Formatters written for the version 6.0.0 should keep working for now but the compatibility layer is rather inconvenient and will be removed with the next major version.
See the commit f50f10f. Changes in lib/formatter.js file are illustrative for how to migrate to the new API.
All commits: 6.0.0...7.0.0
Version 7 roadmap issue: #222
This is a major update. No code left untouched. While the goal was to keep as much compatibility as possible, some client-facing changes were unavoida
This is a major update. No code left untouched. While the goal was to keep as much compatibility as possible, some client-facing changes were unavoidable.
Since the library has the only exported function, it is now self-titled.
Formatting code was rewritten almost entirely to make it aware of block-level tags and to handle HTML whitespace properly. One of popular requests was to support divs, and it is here now, after a lot of effort.
Options are reorganized to make room for some extra format options while making everything more structured. Now tag-specific options live within that tag configuration.
For the majority of changed options there is a compatibility layer that will remain until next major release. But you are encouraged to explore new options since they provide a bit more flexibility.
Because formatters are integral part of the formatting code (as the name suggests), it wasn't possible to provide a compatibility layer.
Please refer to the Readme to see how things are wired now, in case you were using them for anything other than dealing with the lack of block-level tags support.
Cells can make use of extra space with colspan and rowspan attributes. Max column width is defined separately from global wordwrap limit.
Multiple options to cut content in large HTML documents.
By default, any input longer than 16 million characters will be truncated.
Required Node version is now >=8.10.0.
Dependency versions are bumped.
https://github.com/html-to-text/node-html-to-text is the new home.
GitHub should handle all redirects from the old url, so it shouldn't break anything, even if you have a local fork pointing at the old origin. But it is still a good idea to update the url.
Version 6 roadmap issue: #200
preserveNewLines whitespace issue fixed #162
preserveNewLines whitespace issue fixed #162Hard-coded CLI options removed #173
The function fromFile is removed. It was the main reason html-to-text could not be used in the browser #164.
The function fromFile is removed. It was the main reason html-to-text could not be used in the browser #164.
You can get the fromFile functionality back by using the following code
const fs = require('fs');
const { fromString } = require('html-to-text');
// Callback version
const fromFile = (file, options, callback) => {
if (!callback) {
callback = options;
options = {};
}
fs.readFile(file, 'utf8', (err, str) => {
if (err) return callback(err);
callback(null, fromString(str, options));
});
};
// Promise version
const fromFile = (file, option) => fs.promises.readFile(file, 'utf8').then(html => fromString(html, options));
// Sync version
const fromFileSync = (file, options) => fromString(fs.readFileSync(file, 'utf8'), options);
Node versions < 6 are no longer supported.
Support dropped for node version < 4.
unorderedListItemPrefix added.Ability to pass custom formatting via the format option #128
format option #128Basic support for alpha ordered list types added #122
ol type values 1, a and ASupport for the ordered list start attribute added #117
noLinksBrackets options added #119Switched from htmlparser to htmlparser2 #113
htmlparser to htmlparser2 #113Nothing published for this version
Nothing published for this version
* Extra space problem fixed. #88
New option to disable uppercaseHeadings added. #86
uppercaseHeadings added. #86baseElement option. #83longWordSplit option. #83New option decodeOptions added.
decodeOptions added.Breaking Changes:
Fixed: correctly handle HTML entities for images #82
Fixed: using --tables=true doesn't produce the expected results. #80
Preserve newlines in text feature added #75
Support for h5 and h6 tags added #74
Entity regex is now less greedy #69 #70
Uppercase tag processing added. Table center support added. #56
* Support Node 4 engine #64
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →