htpasswd-auth read/write htpasswd files Setup npm install --save simple-htpasswd-auth Checking if a password is valid const htpasswd = require('htpasswd-auth')const file = fs.readFileSync('./path-to-htpasswd') htpasswd.authenticate('username', 'password', file) .then(function (auth) { // auth is true if the password is valid })