14 lines
366 B
JavaScript
14 lines
366 B
JavaScript
import bcrypt from 'bcryptjs';
|
|
|
|
const password = process.argv[2] || 'admin123';
|
|
|
|
bcrypt.hash(password, 10, (err, hash) => {
|
|
if (err) {
|
|
console.error('Error hashing password:', err);
|
|
process.exit(1);
|
|
}
|
|
console.log('Password:', password);
|
|
console.log('Hash:', hash);
|
|
console.log('\nUse this hash in the database schema or when creating users.');
|
|
});
|