redact-basic-auth is a focused utility designed to remove or obscure basic authentication credentials from URLs. This is crucial for logging, debugging, or displaying URLs where sensitive information like usernames and passwords should not be exposed. The package is currently at version 1.0.1, indicating a stable and mature, albeit simple, implementation. Its release cadence is likely very slow, as its functionality is narrowly defined and unlikely to require frequent updates. Key differentiators include its singular focus and minimal API, making it easy to integrate without pulling in larger URL parsing libraries when only basic auth redaction is needed. It operates on string manipulation rather than full URL parsing objects, providing a lightweight solution for specific security and privacy concerns in applications that handle URLs.
npm install redact-basic-authVerified import paths — ran on the pinned version, not inferred.
Demonstrates basic authentication redaction for various URL formats, including those with and without credentials, and how to use it with Node.js URL objects.
For more complex redaction scenarios, consider using a full URL parsing library and performing custom string replacements or object manipulations.
Always test with a diverse set of URLs, especially edge cases, to ensure the desired redaction behavior.
Change `import { redact } from 'redact-basic-auth';` to `import redact from 'redact-basic-auth';`.Ensure the URL strictly follows the basic auth format (e.g., `protocol://username:password@host/path`). The package does not handle credentials in query parameters or other non-standard locations.
No dependency data recorded yet.