Installation
Install @vakra-dev/reader and its system dependencies.
Install the package
npm install @vakra-dev/reader
Prerequisites
- Node.js 22.12.0+. Reader has ESM compatibility issues with Bun - use Node.
- x86_64 architecture for Docker. Chromium is bundled as x86_64 only, so Apple Silicon Macs must use native Node.js or a remote Linux server for Docker deployments.
- Chrome system libraries on Linux (see below). On macOS, Chrome is resolved automatically on first run.
Warning
Bun is not supported. The underlying browser automation stack has ESM compatibility issues with the Bun runtime. Use node or npx tsx.
macOS
Nothing extra needed. Install the package and run your code - Chrome is resolved automatically on first use.
npm install @vakra-dev/reader
node your-script.js
Linux (Debian / Ubuntu)
Reader needs Chrome's system dependencies to run a headless browser. Install them with:
apt-get update && apt-get install -y \
wget gnupg ca-certificates curl \
fonts-liberation fonts-freefont-ttf xvfb \
libasound2 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 \
libcups2 libdbus-1-3 libdrm2 libgbm1 libgtk-3-0 \
libnspr4 libnss3 libxcomposite1 libxdamage1 \
libxfixes3 libxkbcommon0 libxrandr2 libxshmfence1 libxss1 \
xdg-utils
This is the same list used in the official Dockerfile.
Docker
Reader ships with a production-ready Dockerfile under examples/deployment/docker/ in the GitHub repo. The key constraints:
platform: linux/amd64- Chromium is bundled as x86_64shm_size: 2gb- Chrome uses/dev/shmheavily and crashes with the default 64 MBseccomp:unconfined+cap_add: SYS_ADMIN- required for the Chrome sandbox
See the Deployment guide for the full Docker Compose setup.
Verify the install
Create a file, test.js:
import { ReaderClient } from "@vakra-dev/reader";
const reader = new ReaderClient({ verbose: true });
const result = await reader.scrape({
urls: ["https://example.com"],
formats: ["markdown"],
});
console.log(result.data[0].metadata.website.title);
await reader.close();
Run it:
node test.js
If you see a title printed, you're done. If not, check that Chrome's system dependencies are installed and that you're on Node 22+.