
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@luminati-io/mhtml2html
Advanced tools
mhtml2html converts MHTML files to a single HTML file using javascript.
Usage | API | Development
mhtml2html is compatible with Node >= v10.
It has only been tested with MHTML files built and used with the latest versions of Chrome
mhtml2html can be used via the command line (use the --help flag to view all options):
$ mhtml2html <input.mhtml> <output.html>
For programmatic usage, mhtml2html can be used provided a WHATWG DOM parser implementation (e.g jsdom):
const mhtml2html = require('mhtml2html');
const { JSDOM } = require('jsdom');
const mhtml = '<your MHTML string>';
const htmlDoc = mhtml2html.convert(mhtml, { parseDOM: (html) => new JSDOM(html) });
console.log(htmlDoc);
To get started, import mhtml2html:
import mhtml2html from 'mhtml2html';
Or include it as a script in your webpage:
<script src="https://unpkg.com/mhtml2html@<VERSION>" type="javascript" />
By default, mhtml2html will use the DOMParser available in most browsers:
import mhtml2html from 'mhtml2html';
const mhtml = '<your MHTML string>';
const html = mhtml2html.convert(mhtml);
console.log(html);
mhtml2html.parse(mhtml, { htmlOnly = false, parseDOM = <function> });
DOMParser only available in browsers).htmlOnly is set to true. Otherwise it returns an MHTML parsed object:{
"index" : "<html-index-url>",
"media": {
"<asset-url>" : {
"data" : "<resource-string>",
"id": "<frame-id>",
"type": "<resource-type>",
"encoding": "<resource-encoding>"
}
},
"frames": {
"<frame-id>": {
"data": "<resource-string>",
"id": "<frame-id>",
"type:": "<resource-type>",
"encoding": "<resource-encoding>"
}
}
}
mhtml2html.convert(mhtml, { convertIframes = false, parseDOM = <function> });
DOMParser only available in browsers).To build and test mhtml2html:
node_modules haven't been installed already, run yarn install from the root directory.yarn test to build and test the source code.Released under the MIT License
FAQs
Converts an mhtml document to a single html document
We found that @luminati-io/mhtml2html demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.