Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A quick way to generate a random alpha-(and/or)-numeric strings of any length
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.

A quick way to generate a random alphanumeric, numeric or alphabetical strings of any length. I think I probably sourced it from StackOverflow or some forum thread, but I use it a lot - thought it might be worth sharing.

npm install generaterandom

All functions include uppercase and lowercase letters. It's easy to adjust the potential characters yourself.


var generaterandom = require('generaterandom');

generaterandom.string(5); //returns pure alphabet string 5 letters long

generaterandom.number(2); //returns 2 digit number

generaterandom.alphanumeric(32); //returns alphanumeric (letters and numbers) string of length 32
Something went wrong with that request. Please try again.