Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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();
}