Puddinhead docs

Back home

Docs

Puddinhead

Analyzer and anonymizer for emails, phone numbers, credit cards, IP addresses, URLs, and custom patterns.

Reference

Core references.

Install, usage, endpoint, and response details.

01

Quick start

Install

npm install puddinhead
02

Example usage

Sanitize a string

sanitize("My email is test@gmail.com")

-> "My email is [REDACTED]"

03

API endpoint

Analyze text first

POST /analyze
04

Response example

Then sanitize output

POST /sanitize

More Capabilities

Detection and anonymization capabilities.

Detect entities first, then choose how to anonymize each one.

01

Supported entities

Built-in detection types

EMAIL_ADDRESS
PHONE_NUMBER
CREDIT_CARD
IP_ADDRESS
URL
02

Analyze example

Get entity spans and types

analyze("Call +1 (415) 555-2671")
// [{ type: "PHONE_NUMBER", ... }]
03

Operators

Pick an anonymization style

replace
redact
mask
hash
keep
04

Sanitize example

Apply entity-specific operators

{
  "text": "Email test@gmail.com",
  "operators": {
    "EMAIL_ADDRESS": {
      "type": "replace",
      "newValue": "[EMAIL]"
    }
  }
}