Skip to main content

Personal data, found and anonymized

A TypeScript library with no dependencies that finds personal data in text and JSON and replaces it — in your process, on the edge, and before it reaches a model.

npm install anonyma
v1.3.20 runtime dependencies8 compliance presets100% test coverageMIT

Finds what matters

27 categories — e-mail, phones, cards, IBANs, national and tax IDs of many countries, health and vehicle identifiers, API keys — confirmed by check digits and context, so look-alikes are left alone.

Replaces it your way

Redact, mask, pseudonymize, synthesize, hash, encrypt, or tokenize reversibly — per category, from presets for GDPR, LGPD, HIPAA, CCPA, PCI DSS and more, alone or combined.

Safe for LLMs

Prompts leave with {{EMAIL_1}}, answers come back with the real values, also when streamed. Drop-in for the Vercel AI SDK and any MCP server.

Stays in your process

No runtime dependencies, no network, no file system. Runs on Node.js, Bun, Deno, Cloudflare Workers and in the browser — this site included.

Scales to your data

Compiled pipelines, streams that catch values split across chunks, and a command line that scrubs gigabytes of logs, CSV and JSON Lines in constant memory.

Leaves evidence, not data

Hash-chained audit records and signed receipts say what was replaced, under which policy — never what it was.

One call

import { anonymize } from "anonyma";

anonymize("Ana (ana@example.com, CPF 529.982.247-25) paid with 4111 1111 1111 1111", {
preset: ["lgpd", "pci-dss"],
}).text;
// "Ana ([REDACTED], CPF [REDACTED]) paid with [REDACTED]"
// Combined presets: LGPD's redaction beats PCI DSS's mask for the card.

Next: the quick start, the recipes, the benchmarks, or the API reference.