typescript-readibility-native
v0.1.0
Published
Blazing fast TypeScript readability powered by Rust (dom_smoothie + napi-rs)
Downloads
91
Readme
typescript-readibility-native
Blazing-fast Readability for Node/TypeScript backed by Rust (dom_smoothie + napi-rs). Exposes a minimal API with both single and batched parsing to minimize overhead.
Quick start
npm install
npm run build # compiles the native addon (uses npx napi in native/)Usage
const { parseHtml, parseMany, nativeVersion } = require("./js/wrapper.js");
// Single document
const article = parseHtml(htmlString, { url: "https://example.com/page" });
// Batch documents (fewer JS↔Rust crossings)
const results = parseMany([
{ html: htmlA, url: "https://a.test" },
{ html: htmlB, url: "https://b.test" }
]);
console.log(nativeVersion()); // crate version stringScripts
npm test– build + Vitest suite (uses real native binding)npm run build– compile the native addon (runs insidenative/)
Requirements
- Node.js 18+
- Rust toolchain (stable, with Cargo) to build the N-API addon
