Installation
webforai is two npm packages:
| package | what it is | install |
|---|---|---|
webforai | the library: htmlToMarkdown, extractors, loaders and the platform client | npm i webforai |
webforai-cli | the CLI (webforai command), built on the library | none: npx webforai-cli <url> |
Library
npm i webforaiThe library has no CLI or browser dependencies, so it can be embedded in other packages and runs in Node.js, Cloudflare Workers and browsers. See Embedding in your project for the dependency list, runtime support and bundle size.
Loader dependencies
Each loader needs its own extra setup; the core conversion functions need nothing more. The browser libraries are optional peer dependencies: installing webforai never installs them.
| loader | import | setup |
|---|---|---|
| fetch | webforai/loaders/fetch | None. |
| Playwright | webforai/loaders/playwright | npm i playwright-core, then download a browser once with npx playwright-core install chromium. |
| Puppeteer | webforai/loaders/puppeteer | npm i puppeteer (downloads its own Chromium). |
| Cloudflare Browser Rendering | webforai/loaders/cf-puppeteer | npm i @cloudflare/puppeteer and a browser binding in your Wrangler config. |
CLI
The CLI needs no install: npx webforai-cli <url> prints Markdown to stdout. To keep a
webforai command on your PATH, install it globally:
npm i -g webforai-cliSee the CLI reference. Up to v4 the CLI was part of the webforai package
(npx webforai); since v5 that command only points you to webforai-cli. If v4 is installed
globally, run npm uninstall -g webforai first: both own the webforai command.

