Created
April 3, 2015 22:05
-
-
Save phette23/0f0ec3c52dbcda342d06 to your computer and use it in GitHub Desktop.
Simple Node Random Password Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
// usage: | |
// > randpw | |
// IKS1L2H1AMOx | |
// > randpw --length 22 | |
// IKS1L2H1AMOxBs4d8qxDXY | |
// > randpw | pbcopy # pipe to Mac clipboard | |
var chance = new require('chance')() | |
var args = require('minimist')(process.argv.slice(2)) | |
var pool = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890' | |
var pw = chance.string({ | |
pool: pool, | |
length: args.l || args.length || 12 | |
}) | |
process.stdout.write(pw) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment