Menu

Building a 40 MB RAM Web-to-Markdown Crawler in Pure Node.js (0.62s for 5 Sites, Auto /llms.txt Parsing, Zero Browsers)
📰

Building a 40 MB RAM Web-to-Markdown Crawler in Pure Node.js (0.62s for 5 Sites, Auto /llms.txt Parsing, Zero Browsers)

DEV Community: typescript·apexautomationlabs·about 11 hours ago
#g2o2809v
#devtotypescript#devto#dev#html#apify
Long article (474 words) — no AI summary yet.
Reading 0:00
15s threshold

Most web-to-Markdown scrapers for RAG and AI agents boot an entire headless Chromium process just to read static documentation pages, marketing sites, and blog articles. That adds 3–5 seconds of cold-start latency, 400+ MB of container RAM, and extra compute costs—even when 90% of target pages serve complete HTML over a plain HTTP GET .

We built an open-source TypeScript + Cheerio Apify Actor ( GitHub | Apify Store ) that converts single URLs, batches, same-domain trees, and XML sitemaps into clean RAG-ready Markdown inside a 128 MB RAM container at $1.00 / 1,000 extracted pages .

Key Engineering Decisions

Bounded Streaming & Direct Node Entrypoint ( 39.8 MB Peak RAM): Launching directly via CMD ["node", "--max-old-space-size=88", "dist/main.js"] , streaming response bodies with a 750 KB byte cap, immediately cancelling non-HTML streams ( application/pdf , images, binary assets), and discarding raw HTML strings right after DOM conversion kept live cloud peak RAM at 39.8 MB ( 22.8 MB average).

Automatic…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.