basic-authorization-header

0.2.7 • Public • Published

basic-authorization-header

RFC2617 basic authorization header from username and password.

Build Status Code Climate js-standard-style

npm install basic-authorization-header --save
npm stats

npm NPM downloads Dependency Status

Example

var basic = require('basic-authorization-header');
var headers = {
  'Authorization': basic("Aladdin", "open sesame"),
};
 
//=> { Authorization: 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==' }

API

basic(user, pass)

arguments
  • user: (String) username.
  • pass: (String) password.
returns
  • (String) basic authorization header value.

Reference

Notes

If you just want the token, check out basic-auth-token.

Licenses

GitHub license

Package Sidebar

Install

npm i basic-authorization-header

Weekly Downloads

4,478

Version

0.2.7

License

MIT

Last publish

Collaborators

  • wilmoore