https://github.com/funnyhcat-dotcom/json-sample-redactor
Redact secrets and personal data from JSON before sharing examples.
https://github.com/funnyhcat-dotcom/json-sample-redactor
cli developer-tools json nodejs pii privacy redaction secrets security
Last synced: 3 days ago
JSON representation
Redact secrets and personal data from JSON before sharing examples.
- Host: GitHub
- URL: https://github.com/funnyhcat-dotcom/json-sample-redactor
- Owner: funnyhcat-dotcom
- License: other
- Created: 2026-06-28T23:11:31.000Z (3 days ago)
- Default Branch: main
- Last Pushed: 2026-06-28T23:11:38.000Z (3 days ago)
- Last Synced: 2026-06-29T00:06:06.057Z (3 days ago)
- Topics: cli, developer-tools, json, nodejs, pii, privacy, redaction, secrets, security
- Language: JavaScript
- Size: 0 Bytes
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# json-sample-redactor
Redact secrets and personal data from JSON before sharing examples.
Use it before pasting API responses, logs, webhook payloads, bug reports, or docs examples into GitHub issues, Slack, tickets, or public READMEs.
## Quick start
```bash
npx json-sample-redactor response.json
```
```bash
# stdin works too
cat response.json | npx json-sample-redactor --format report
# compact output for scripts
npx json-sample-redactor response.json --format compact > safe-response.json
# add your own sensitive key pattern
npx json-sample-redactor response.json --key tenant --key organization
```
## What gets redacted
- Sensitive keys like `password`, `token`, `secret`, `apiKey`, `authorization`, `cookie`, `session`
- Personal data keys like `email`, `phone`, `address`, `ssn`, `creditCard`
- Sensitive values inside strings: emails, JWTs, GitHub tokens, AWS access keys, bearer tokens, phone-like numbers, card-like numbers
## CLI
```text
json-sample-redactor [file] [options]
json-redact [file] [options]
```
Options:
- `--format pretty|compact|report`
- `--jsonl`
- `--key ` for custom key regexes
- `--keep-shape` for harmless example-looking replacements
- `-o, --output `
## Example
Input:
```json
{
"email": "ada@example.com",
"apiKey": "ghp_abcdefghijklmnopqrstuvwxyz123456",
"message": "Contact ada@example.com"
}
```
Output:
```json
{
"email": "[REDACTED]",
"apiKey": "[REDACTED]",
"message": "Contact [REDACTED_EMAIL]"
}
```
## License
MIT