db-hygiene
v0.1.0
Published
Scan databases and SQL dumps for PII & credentials; optionally anonymise with anonymiser. CLI-first, CI/CD friendly.
Maintainers
Readme
db-hygiene
Scan databases and SQL dumps for PII & credentials; optionally anonymise with anonymiser. CLI-first, CI/CD friendly.
Install
npm install db-hygieneOr run without installing:
npx db-hygiene <command>Commands
| Command | Description |
|------------|-------------|
| scan | Detect PII and credentials (alias for audit) |
| audit | Same as scan — read-only, no writes |
| anonymise| Run anonymisation (delegates to anonymiser) |
| report | Output report (human-readable or JSON) |
Usage
npx db-hygiene scan --config audit.config.js
npx db-hygiene audit
npx db-hygiene anonymise --config anonymiser.config.mjs
npx db-hygiene report
npx db-hygiene --help
npx db-hygiene --versionExit codes
| Code | Meaning |
|------|---------|
| 0 | Clean / no findings |
| 2 | Findings present |
| 1 | Error |
Use these in CI to fail pipelines when issues are found, e.g. if [ $? -eq 2 ]; then exit 1; fi or your runner’s equivalent.
CI example
# GitHub Actions
- run: npx db-hygiene scan --config audit.config.js
- run: npx db-hygiene anonymise --config anonymiser.config.mjsRequirements
- Node.js >= 18
License
MIT
