1.0.2 • Published 3 years ago

htpasswd-authenticator v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

htpasswd-authenticator

Forked from dickeyxxx's htpasswd-auth This fork contains updated hash node modules which allows usage for node >8

read/write htpasswd files

Setup

npm install --save htpasswd-authenticator

Checking if a password is valid

var htpasswd = require('htpasswd-authenticator');
var file     = fs.readFileSync('./path-to-htpasswd', 'utf-8');

htpasswd.authenticate('dickeyxxx', 'pass', file)
.then(function (auth) {
  // auth is true if the password is valid
});