- htpasswd utility to create,edit,view .htpasswd file
npm install @devpodio/htpasswd --save
oryarn add @devpodio/htpasswd
const HTPASSWD = require('@devpodio/htpasswd')
const htpasswd = new HTPASSWD(options[Object])
options.path
- Absolute path to save the .htpasswd, defaults toprocess.env.HOME
orprocess.cwd()
options.encryption
- Type of encryption to use. Accepted values:bcrypt
,sha1
,md5
,crypt
,plain
. Defaults tobcrypt
add
Add a new user, passwordadd(user[String],password[String])
edit
Edit a user with a new passwordedit(user[String],newpassword[String])
delete
Delete a user from the listdelete(user[String])
view
View the list of user and password =>returns [Object]
htpasswd [command] <options>
htpasswd --help
for more info