Framework-agnostic TypeScript functions for client-side file conversion. Zero server calls — everything runs in the user's browser.
npm install @convertprivately/coreHeavy conversion libraries (heic2any, pdf-lib, tesseract.js, @imgly/background-removal, etc.) are optional peer dependencies — loaded dynamically only when you call a function that needs them. Install what you use:
npm install heic2any # HEIC decode
npm install browser-image-compression # image compress
npm install pdf-lib # PDF operations
npm install pdfjs-dist # OCR on PDFs
npm install tesseract.js # OCR
npm install qrcode # QR generation
npm install papaparse # CSV ↔ JSONEvery converter exports a single async function with a consistent signature:
convertX(input: File | Blob | ArrayBuffer, options?: ConvertXOptions): Promise<Blob>input— the source file or bytes.options— per-converter settings (format, quality, etc.).- Returns a
Blobready forURL.createObjectURL()or download.
Import each converter via a deep path to keep bundle size small:
import { heicToImage } from "@convertprivately/core/image/heic";
import { avifToImage } from "@convertprivately/core/image/avif";
import { compressImage } from "@convertprivately/core/image/compress";
import { compressPdf } from "@convertprivately/core/pdf/compress";
import { encodeBase64, decodeBase64 } from "@convertprivately/core/text/base64";
import { csvToJson, jsonToCsv } from "@convertprivately/core/text/csv-json";
import { convertUnit } from "@convertprivately/core/units";
import { recognizeText } from "@convertprivately/core/ocr";
import { generateQr } from "@convertprivately/core/qr";import { heicToImage } from "@convertprivately/core/image/heic";
const blob = await heicToImage(file, { format: "jpeg", quality: 0.9 });
const url = URL.createObjectURL(blob);Every function in this package:
- Runs entirely in the browser — no
fetch()to any server. - Loads optional dependencies from the user's own
node_modules(no CDN unless you import fromesm.shyourself). - Returns results as
Blob/string/objectfor local use or download.
Audit the source — it's small.
MIT