Skip to content

Installation

webforai is two npm packages:

packagewhat it isinstall
webforaithe library: htmlToMarkdown, extractors, loaders and the platform clientnpm i webforai
webforai-clithe CLI (webforai command), built on the librarynone: npx webforai-cli <url>

Library

npm
npm i webforai

The 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.

loaderimportsetup
fetchwebforai/loaders/fetchNone.
Playwrightwebforai/loaders/playwrightnpm i playwright-core, then download a browser once with npx playwright-core install chromium.
Puppeteerwebforai/loaders/puppeteernpm i puppeteer (downloads its own Chromium).
Cloudflare Browser Renderingwebforai/loaders/cf-puppeteernpm 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-cli

See 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.