{"repo":"jshttp/basic-auth","free":true,"listed":false,"github":"https://github.com/jshttp/basic-auth","clone":"git clone https://github.com/jshttp/basic-auth.git","description":"Generic basic auth Authorization header field parser","language":"TypeScript","stars":714,"topics":["javascript","nodejs","basic-auth","http"],"license":"MIT","category":"auth-billing-email","readme_excerpt":"basic-auth [![NPM Version][npm-version-image]][npm-url] [![NPM Downloads][npm-downloads-image]][npm-url] [![Node.js Version][node-image]][node-url] [![Build Status][ci-image]][ci-url] [![Coverage Status][coveralls-image]][coveralls-url] Generic basic auth Authorization header field parser for whatever. Installation This is a Node.js module available through the npm registry. Installation is done using the npm install command: API parse(string) Parse a basic auth authorization header string. This will return an object with name and pass properties, or undefined if the string is invalid. format(credentials) Format a credentials object with name and pass properties as a basic auth authorization header string. Example Pass a Basic auth header to the parse() method. If parsing fails undefined is returned, otherwise an object with .name and .pass . A header string from any other location can also be parsed for example a Proxy-Authorization header: A credentials object can be formatted with auth.format as basic auth header string. With vanilla node.js http server License MIT [ci-image]: https://badgen.net/github/checks/jshttp/basic-auth/master?label=ci [ci-url]: https://github.com/jshttp/basic-auth/actions/workflows/ci.yml [coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/basic-auth/master [coveralls-url]: https://coveralls.io/r/jshttp/basic-auth?branch=master [node-image]: https://badgen.net/npm/node/basic-auth [node-url]: https://nodejs.org/en/download [npm-downloads","default_branch":null,"files":null,"tree":[],"storefront":"/r/jshttp","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/jshttp/basic-auth/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}