blob: 5859757c6d05d605b192e316b7731b2880f54924 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# basic-auth
Generic basic auth Authorization header field parser for whatever.
## Installation
```
$ npm install basic-auth
```
## Example
Pass a node request or koa Context object to the module exported. If
parsing fails `undefined` is returned, otherwise an object with
`.name` and `.pass`.
```js
var auth = require('basic-auth');
var user = auth(req);
// => { name: 'something', pass: 'whatever' }
```
# License
MIT
|