Introduction
What is pii-mask and why it exists.
What is pii-mask?
@pii-mask is a developer-first PII masking toolkit for JavaScript and TypeScript. It detects and masks personally identifiable information in strings, objects, arrays, files, and React components.
Why pii-mask?
- Zero server calls — all masking runs locally, in Node.js or the browser
- Six masking modes — mask, redact, anonymize, pseudonymize, tokenize, substitute
- 21+ built-in detectors — emails, phones, government IDs, financial data, and more
- Global coverage — detectors for Nigeria, India, US, UK, and other regions
- Type-safe — written in TypeScript with strict mode, no
any
Packages
| Package | Role |
|---|---|
@pii-mask/core | Zero-dependency masking engine |
@pii-mask/cli | File I/O adapter for CLI usage |
@pii-mask/react | React components and hooks |
@pii-mask/nlp | NLP-powered name/place detection |