simple-auth-basic is a lightweight Node.js module designed for parsing HTTP Basic Authorization headers. It extracts the username and password from the 'Authorization' header in an incoming request or a raw header string, returning an object with `name` and `pass` properties. If the header is invalid or missing, it returns `undefined`. The current stable version is 2.0.8. As a focused utility for a well-established standard, its release cadence is generally slow, primarily for maintenance and compatibility updates rather than new features. Its key differentiator is its simplicity and singular focus on parsing the header, leaving credential validation to the application logic, often paired with a timing-safe string comparison library like `tsscmp` for security.
Verified import paths — ran on the pinned version, not inferred.
While the README shows CJS `require()`, modern Node.js applications should prefer ESM `import`. This package should be compatible with both.
The `parse` function is a method on the default export, not a named export itself.
Demonstrates setting up a basic Node.js HTTP server that uses simple-auth-basic to parse Authorization headers and perform credential validation. It includes an example of using `tsscmp` for secure password comparison.
Breaking-change detection hasn't run for this library yet.
CVE tracking and dependency tree are planned for a later release.