Production-ready PII detection and redaction library with 558+ patterns, document processing, OCR, RBAC, and enterprise features
npm install @openredaction/openredactionProduction-ready PII detection and redaction library with 558+ built-in patterns, multiple redaction modes, compliance presets, and zero dependencies.
``bash`
npm install openredaction
`typescript
import { OpenRedaction } from 'openredaction';
const shield = new OpenRedaction();
const result = shield.detect("Email john@example.com or call 07700900123");
console.log(result.redacted);
// "Email [EMAIL_9619] or call [PHONE_UK_MOBILE_9478]"
`
Full documentation available at GitHub
- ๐ Fast & Accurate - 10-20ms for 2-3KB text
- ๐ฏ 558+ PII Patterns - Comprehensive coverage across multiple categories:
- Personal Data (Email, Phone, SSN, Passports, Driver's Licenses)
- Financial (Credit Cards, IBANs, Cryptocurrencies)
- Government IDs (National IDs for 40+ countries globally)
- Healthcare (Medical Record Numbers, Prescriptions, Biometric Data)
- Emergency Services (911 Call References, Police Reports, Fire Incidents)
- Digital Identity (Discord, Steam, Social Media, Gaming Platforms)
- Vehicles & Transportation (VIN, License Plates, Tracking Numbers)
- Aviation (Flight Numbers, IATA Codes, Aircraft Registration)
- Maritime (IMO Numbers, MMSI, Ship Registration)
- Industry-Specific (20+ industries including Retail, Legal, Real Estate, Logistics, Hospitality, Environmental & Regulatory)
- ๐จ Multiple Redaction Modes - Choose how PII is replaced:
- Placeholder: [EMAIL_1234] (default, fully reversible)j*@example.com
- Mask Middle: , 555--4567 (partial visibility)*
- Mask All: (complete masking)XXX-XX-XXXX
- Format Preserving: (maintains structure)user47@example.com` (realistic fake data)
- Token Replace:
- โ
Built-in Validators - Luhn, IBAN, NHS, National ID checksums
- ๐ Compliance Presets - GDPR, HIPAA, CCPA, PCI-DSS
- ๐ญ Deterministic Placeholders - Consistent redaction for same values
- ๐ Global Coverage - 40+ countries across Europe, Middle East, Asia-Pacific, Americas, Africa, Oceania, Central Asia
- ๐ณ Zero Dependencies - No external packages required
- ๐ TypeScript Native - Full type safety and IntelliSense
- ๐งช 99%+ Test Coverage - 415+ passing tests
MIT