@ce1pers/use-password
TypeScript icon, indicating that this package has built-in type declarations

1.1.4 • Public • Published

@ce1pers/use-password

Many useful hook related to password.

Installation

npm

npm i @ce1pers/use-password

yarn

yarn add @ce1pers/use-password

Usage

// Import library.
import { usePassword } from "@ce1pers/use-password";

// Getting randomly password generate function.
const { generate } = usePassword();

// Declare conditions.
const passwordLength = 20;
const useNumbers = true;
const useSymbols = true;
const useLowercaseLetters = false;
const useUppercaseLetters = true;

// Generate randomly password.
const { ok, data, error } = generate({
  passwordLength,
  useNumbers,
  useSymbols,
  useLowercaseLetters,
  useUppercaseLetters,
});

if (ok) {
  console.log(data); // Randomly password data.

  // Write you want process.
} else {
  console.warn(error); // Error code & message.

  // Write you want process.
}

Package Sidebar

Install

npm i @ce1pers/use-password

Weekly Downloads

2

Version

1.1.4

License

MIT

Unpacked Size

21.4 kB

Total Files

12

Last publish

Collaborators

  • __coma__