How to use @foal/password - 1 common examples

To help you get started, we’ve selected a few @foal/password examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github FoalTS / foal / samples / tutorials / 02-multi-user-todo-list-mpa / src / scripts / create-user.ts View on Github external
export async function main(args) {
  await createConnection();

  const user = new User();
  user.email = args.email;

  if (await isCommon(args.password)) {
    console.log('This password is too common. Please choose another one.');
    return;
  }
  await user.setPassword(args.password);

  try {
    console.log(
      await getManager().save(user)
    );
  } catch (error) {
    console.log(error.message);
  }

  await getConnection().close();
}

@foal/password

Password utilities for FoalTS

MIT
Latest version published 27 days ago

Package Health Score

78 / 100
Full package analysis

Popular @foal/password functions