
Product
PHP and Composer Support Is Now in Beta
Socket’s PHP and Composer support is now in Beta for all customers, with PHP reachability analysis generally available.
@page2ai/core
Advanced tools
Extract clean Markdown from any web page HTML. Works in Node.js (via linkedom) and browsers. Powers the Page2AI extension and @page2ai/mcp server.
Extract clean Markdown from any web page HTML. Works in Node.js (via linkedom) and in browsers. Powers the Page2AI extension and the @page2ai/mcp server.
htmlToMarkdown(html, opts) or fetchAndConvert(url, opts) — zero external API calls, uses linkedom for parsingBrowserAdapter and the PageAdapter interface; the full extract pipeline lives in the extension repo (planned for v0.2 migration)npm install @page2ai/core
import { htmlToMarkdown, fetchAndConvert } from '@page2ai/core';
// From an HTML string
const html = `<article><h1>Hello</h1><p>World</p></article>`;
const { markdown, title, charCount } = htmlToMarkdown(html, {
baseUrl: 'https://example.com/hello',
includeFrontmatter: true,
});
console.log(markdown);
// From a URL
const result = await fetchAndConvert('https://docs.anthropic.com/en/api/messages', {
timeoutMs: 15000,
});
console.log(result.markdown);
htmlToMarkdown(html, opts?)Converts an HTML string to Markdown. Synchronous.
html (string) — the HTML to parseopts.baseUrl (string) — URL used to resolve relative links (default: 'about:blank')opts.profile (string) — extraction profile: 'auto' | 'docs' | 'marketing' | 'research' | 'dashboard' | 'wordpress-marketing' (default: 'auto', v0.2)opts.includeFrontmatter (boolean) — emit YAML frontmatter block (default: true)opts.includeImages (boolean) — emit image links (default: true)Returns { markdown, title, baseUrl, charCount, extractedAt }.
fetchAndConvert(url, opts?)Fetches a URL and converts it to Markdown. Async.
url (string) — the URL to fetchopts.timeoutMs (number) — abort after N ms (default: 15000)opts.userAgent (string) — custom user agent (default: page2ai-core/0.1)htmlToMarkdown optionsUses Node 18+ built-in fetch(). Follows redirects; passes the final URL to htmlToMarkdown as baseUrl unless overridden.
main article > article > main > [role="main"] > body)# ), paragraphs, lists (ordered/unordered, nested), links [text](url), images , code blocks (with language tag when detectable), tables (| a | b |), blockquotes, inline formatting (bold, italic, code)title, source, captured_at, language, description, canonical, og_title, og_description, author, published, extractor, extractor_version<details> auto-expansion::before / ::after contentAll the above ship with the Chrome/Firefox extension, which runs the full lib/core/* pipeline against a live browser DOM. See github.com/igorsaevets/page2ai-extension.
lib/core/html-to-md.ts via PageAdapter, browser entry migrated from extension repo<div id="root"> from static HTML currently produce a graceful fallback error under v0.1 — the SPA adapter in v0.3 will handle them.Two implementations behind a single PageAdapter interface:
src/
├── shared/ # No DOM assumptions — works with any adapter
│ ├── page-adapter.ts # PageAdapter interface + defaults + nodeCssEscape
│ ├── utils.ts # pure helpers (absUrl, escapeMd, etc.)
│ ├── types.ts # all TypeScript interfaces
│ ├── constants.ts # DEFAULTS, BLOCK_TAGS, PII patterns
│ └── profiles.ts # profile presets
├── node/ # LinkedomAdapter + htmlToMarkdown + basic-renderer
│ ├── index.ts
│ ├── linkedom-adapter.ts
│ └── basic-renderer.ts
└── browser/ # BrowserAdapter (v0.1) + extract() (v0.2)
├── index.ts
└── browser-adapter.ts
git clone https://github.com/igorsaevets/page2ai-core
cd page2ai-core
npm install
npm run build # tsc → dist/
npm test # vitest
npm run typecheck # tsc --noEmit
@page2ai/mcp — MCP server for Claude Desktop, Cursor, Windsurf, Zedswh:1:snp:05123c51ef9e7c0aeb06f42b1263c07a8d26999aReleases from v0.1.1 onward are published from GitHub Actions with npm provenance. Each published version carries a Sigstore attestation recording which commit and which workflow run produced the tarball, logged in the public Rekor transparency ledger. npmjs.com shows a provenance badge next to the version, linking to both.
Verify it yourself, without trusting this README:
npm audit signatures
npm view @page2ai/core --json | jq '.dist.attestations'
The point is that the link between the source you can read and the artifact you install is checkable by a third party rather than asserted here.
MIT — Copyright (c) 2026 Igor Saevets. See LICENSE.
FAQs
Extract clean Markdown from any web page HTML. Works in Node.js (via linkedom) and browsers. Powers the Page2AI extension and @page2ai/mcp server.
The npm package @page2ai/core receives a total of 343 weekly downloads. As such, @page2ai/core popularity was classified as not popular.
We found that @page2ai/core 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.

Product
Socket’s PHP and Composer support is now in Beta for all customers, with PHP reachability analysis generally available.

Product
Socket is bringing experimental protection to Firefox, scanning 97,000+ extensions in Mozilla's official directory for malware and risky updates.

Research
/Security News
Three compromised Rust crates pulled in a malicious dependency that downloaded and executed cross-platform malware during Cargo builds.