Input stays readable enough to debug without leaking private addresses or identifiers.
PII detection. Anonymization. API-ready output.
Sanitize sensitive text before it leaves your app.
Puddinhead detects and anonymizes emails, phone numbers, credit
cards, IP addresses, and URLs in logs, form data, and API payloads
with analyze(), anonymize(), and
sanitize() across application and HTTP workflows.
- Detect
EMAIL_ADDRESS,PHONE_NUMBER,CREDIT_CARD,IP_ADDRESS, andURL - Choose
replace,redact,mask,hash, orkeepper entity - Use the package directly or call
POST /analyzeandPOST /sanitize
Package
Node · logs · API Production-ready text protectionResponse
{ "sanitized": "..." } Same shape every requestHow It Works
PII detection and anonymization pipeline.
The pipeline accepts text, identifies supported entities, applies the configured operator, and returns sanitized output while preserving the surrounding context.
1. Input
Please email me at test@gmail.com Raw text enters the sanitizer.2. Detect
Email pattern found The email address is identified as sensitive.3. Replace
[REDACTED] Only the matched value is swapped out.4. Output
Please email me at [REDACTED] Safe text is returned to your app or API.Input
sanitize("Please email me at test@gmail.com")
Output
"Please email me at [REDACTED]"
Receive the text
The package accepts a normal string from your app, job, log formatter, or HTTP request body.
Scan for sensitive patterns
The analyzer scans the input and identifies values that match supported entity types such as email addresses and phone numbers.
Replace only the match
Instead of rewriting the whole sentence, the matched email is
replaced with [REDACTED] so the rest of the message
stays readable.
Return a safe result
If you call sanitize(), you get back a string. If
you use POST /sanitize, the same value is returned
inside JSON as {"sanitized":"..."}.
Docs
Core docs in four blocks.
Install, usage, API, and response examples.
Quick start
Install the package
npm install puddinhead
Example usage
Redact email addresses
sanitize("My email is test@gmail.com")
-> "My email is [REDACTED]"
API endpoint
Send a single request
POST /sanitize
Response example
Return the sanitized value
{
"sanitized": "..."
}
Guardrails built in
Redaction should be transparent and easy to inspect.
Detection, operator choice, and output shape stay explicit so the behavior is easy to review, test, and trust in production.
Consistent placeholders
The output stays predictable so downstream tooling does not need custom parsing.
Small API surface
There is less room for confusion when the docs fit on one page and the endpoint fits in one line.
JSON-safe responses
The API returns a single sanitized field that is straightforward to inspect and forward.
Easy to review
Because the surface area is narrow, regressions are easier to spot before they ship.