
Research
Shai-Hulud Descends to Hades: Miasma Worm Campaign Spreads with New PyPI Wave
Socket found 37 malicious PyPI wheels that abuse Python startup hooks to launch a Bun-powered credential stealer tied to Mini Shai-Hulud/Miasma.
@mdream/js
Advanced tools
JavaScript HTML-to-Markdown engine for mdream. Escape hatch for hooks and edge runtimes.
JavaScript HTML-to-Markdown engine for mdream. Use this package when you need plugin hooks, custom transform plugins, or are targeting edge runtimes where the native Rust engine cannot run.
This package consolidates functionality previously split across @mdream/core, @mdream/shared, and @mdream/llms-txt.
For most use cases, prefer the main
mdreampackage which uses the Rust engine for significantly better performance. Reach for@mdream/jswhen you need hooks, custom plugins, or edge runtime compatibility.
pnpm add @mdream/js
| Import | Description |
|---|---|
@mdream/js | Core htmlToMarkdown and streamHtmlToMarkdown APIs |
@mdream/js/plugins | Plugin utilities: createPlugin, extractionPlugin, filterPlugin, frontmatterPlugin, isolateMainPlugin, tailwindPlugin |
@mdream/js/preset/minimal | withMinimalPreset -- declarative config for frontmatter, isolateMain, tailwind, and filter plugins |
@mdream/js/negotiate | HTTP content negotiation: shouldServeMarkdown, parseAcceptHeader |
@mdream/js/parse | Low-level HTML parser: parseHtml, parseHtmlStream |
@mdream/js/splitter | Single-pass markdown splitter: htmlToMarkdownSplitChunks, htmlToMarkdownSplitChunksStream |
@mdream/js/llms-txt | llms.txt artifact generation: generateLlmsTxtArtifacts, createLlmsTxtStream |
import { htmlToMarkdown } from '@mdream/js'
const md = htmlToMarkdown('<h1>Hello</h1><p>World</p>')
// # Hello\n\nWorld
import { streamHtmlToMarkdown } from '@mdream/js'
const stream = streamHtmlToMarkdown(response.body, {
origin: 'https://example.com',
})
for await (const chunk of stream) {
process.stdout.write(chunk)
}
import { htmlToMarkdown } from '@mdream/js'
import { createPlugin } from '@mdream/js/plugins'
const md = htmlToMarkdown(html, {
hooks: [
createPlugin({
onNodeEnter(element) {
if (element.name === 'aside')
return '' // skip asides
},
}),
],
})
import { htmlToMarkdown } from '@mdream/js'
import { withMinimalPreset } from '@mdream/js/preset/minimal'
const md = htmlToMarkdown(html, withMinimalPreset({
origin: 'https://example.com',
}))
import { shouldServeMarkdown } from '@mdream/js/negotiate'
// Returns true when Accept header prefers text/markdown over text/html
if (shouldServeMarkdown(request.headers.accept, request.headers['sec-fetch-dest'])) {
return new Response(markdown, { headers: { 'content-type': 'text/markdown' } })
}
import { generateLlmsTxtArtifacts } from '@mdream/js/llms-txt'
const result = await generateLlmsTxtArtifacts({
files: processedPages,
siteName: 'My Site',
origin: 'https://example.com',
generateFull: true,
})
// result.llmsTxt -- index file with links
// result.llmsFullTxt -- single file with all page content
import { htmlToMarkdownSplitChunks } from '@mdream/js/splitter'
const chunks = htmlToMarkdownSplitChunks(html, {
chunkSize: 1000,
origin: 'https://example.com',
})
FAQs
JavaScript HTML-to-Markdown engine for mdream. Escape hatch for hooks and edge runtimes.
The npm package @mdream/js receives a total of 2,915 weekly downloads. As such, @mdream/js popularity was classified as popular.
We found that @mdream/js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.

Research
Socket found 37 malicious PyPI wheels that abuse Python startup hooks to launch a Bun-powered credential stealer tied to Mini Shai-Hulud/Miasma.

Security News
RubyGems and Bundler 4.0.13 introduced an opt-in cooldown feature that delays newly published gems during dependency resolution.

Security News
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.