17 lines
346 B
JavaScript
17 lines
346 B
JavaScript
import bcrypt from 'bcrypt';
|
|
|
|
async function hashPassword() {
|
|
const password = process.argv[2];
|
|
|
|
if (!password) {
|
|
console.error('Usage: bun run src/scripts/hash-password.js <password>');
|
|
process.exit(1);
|
|
}
|
|
|
|
const hash = await bcrypt.hash(password, 12);
|
|
console.log('Password hash:');
|
|
console.log(hash);
|
|
}
|
|
|
|
hashPassword();
|