nomad-sdk
v0.1.3
Published
Nomad headless browser engine — TypeScript SDK
Maintainers
Readme
Nomad SDK — TypeScript Client
Nomad is a zero-overhead headless browser engine. No DOM tree, no GPU, no UI — just raw structured page state over HTTP.
~4 MB binary · ~6 MB idle RSS · ~17,000 req/s · 11 output formatsThis package wraps Nomad's HTTP API with full TypeScript types. Use it with Node.js, Bun, Deno, or the browser.
npm install nomad-sdkWhat is Nomad?
Traditional headless browsers (Chrome, Playwright) spin up a full browser process — DOM tree, layout engine, GPU pipeline, JS runtime — all for data extraction. That's like using a 18-wheeler to get groceries.
Nomad takes a different approach:
HTML → Parse → CSS → Layout → ECS Frame → Format → JSONEvery page becomes a single contiguous EcsFrame — parallel arrays for
IDs, positions, styles, content. Cache-contiguous, SIMD-friendly,
trivially serializable. 11 zero-copy output formats on top.
Result: 100–1000× faster than Chrome headless, 1/100th the memory, zero memory leaks.
Usage
import { Nomad, Formats } from 'nomad-sdk';
const nomad = new Nomad('http://localhost:8000');
// Fetch a page
const page = await nomad.navigate(
'https://news.ycombinator.com',
Formats.SUMMARY,
);
console.log(page.data.title, page.data.entity_count);
// Search interactive elements
const links = await nomad.find({ tag: 'a' });
for (const link of links.data) {
console.log(link.text, '->', link.href);
}Response Envelope
Every method returns Envelope<T>:
interface Envelope<T> {
success: boolean;
data: T;
error?: string;
meta: {
duration_ms: number;
daemon_rss_kb?: number;
daemon_uptime_secs?: number;
daemon_connections?: number;
};
}API Reference
| Method | Description |
|--------|-------------|
| navigate(url, format?, tabId?) | Fetch and format a page |
| search(query) | DuckDuckGo search |
| click(entityId, tabId?) | Click element by ID |
| input(entityId, value, tabId?) | Type text into element |
| find(query, tabId?) | Semantic entity search |
| snapshot(tabId?) | Current page state |
| evaluate(js, tabId?) | Execute JavaScript |
| scroll(dy?, tabId?) | Scroll viewport |
| resize(w?, h?, tabId?) | Resize viewport |
| newTab(url?) | Create new tab |
| closeTab(tabId) | Close a tab |
| goBack(tabId?) | Navigate back |
| goForward(tabId?) | Navigate forward |
| health() | Daemon health |
| stats() | Backend metrics |
| formats() | List output formats |
| actionLog(tabId?) | Action history |
| login(apiKey) | Authenticate |
| validate() | Check token validity |
React Hook
Requires React 18+.
import { Nomad } from 'nomad-sdk';
import { useNomad } from 'nomad-sdk/dist/react';
function Dashboard() {
const nomad = new Nomad('http://localhost:8000');
const { data, loading } = useNomad(() => nomad.health(), []);
if (loading) return <div>Loading...</div>;
return <div>RSS: {data?.rss_kb} KB</div>;
}CLI
npx nomad-sdk health
npx nomad-sdk navigate https://example.com --format 4
npx nomad-sdk search "rust programming"
npx nomad-sdk formatsLicense
AGPL-3.0. Commercial licenses available for proprietary use — see COMMERCIAL.md.
