basic-authorization-header

RFC2617 basic authorization header from username and password.

Usage no npm install needed!

<script type="module">
  import basicAuthorizationHeader from 'https://cdn.skypack.dev/basic-authorization-header';
</script>

README

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