API Reference5 min read•Updated July 2026
JavaScript / TypeScript API Reference
Client-side and Server-side Node.js / Edge runtime API docs.
TypeScript / Node.js Usage
Import and compress prompts in TypeScript applications:
app.ts
import { compress } from "@llmslim/core";
const result = compress(longPrompt, {
targetRatio: 0.5,
preserveCode: true,
});
console.log(`Saved ${result.savingsPercent}% tokens!`);
console.log(result.compressedText);Frequently Asked Questions
Is the JS package compatible with Cloudflare Workers and Vercel Edge?
Yes. @llmslim/core uses zero native Node bindings and runs natively on Vercel Edge, Deno, and Cloudflare Workers.