Skip to content

API Reference

generatePassword(options?)

Generates a secure random password.

Parameters

  • options (optional): PasswordOptions object.

Returns

  • string: The generated password.

PasswordOptions

Interface for password generation options.

OptionTypeDefaultDescription
lengthnumber12Length of the password
includeUppercasebooleantrueInclude A-Z
includeLowercasebooleantrueInclude a-z
includeNumbersbooleantrueInclude 0-9
includeSymbolsbooleantrueInclude !@#$%^&*...
humanReadablebooleanfalseGenerate a pronounceable password