mtfosbot/bin/hashPass.js

18 lines
371 B
JavaScript

require('module-alias/register')
const {
hashPassword
} = require('@libs/tools')
let args = process.argv
let pass = args[2] || ''
if (typeof pass !== 'string' || pass.trim().length === 0) {
console.log('command: node hashPass <pass string>')
process.exit(1)
}
hashPassword(pass).then(r => {
console.log(`Password: ${r}`)
}).catch(err => {
console.log(err)
})