UserGen
This is a simple module that generates user data. Originally intended for testing purposes, some of the methods could be useful outside of testing, such as username generation.
Installation
If you're using it for testing (usual case):
npm install usergen --save-dev
Otherwise:
npm install usergen --save
Usage Example
Generating an entire user (to save to Mongoose, in this case):
// Require the module.var usergen = ; // Generate user data.var user = usergen; // Example use case: saving this user to Mongoose.SomeAwesomeModel;
Generating a username with custom data:
var usergen = ;var data = Adj: 'Super' 'Awesome' Verb: 'Jump' 'Fly' Noun: 'Wizard' 'Robot' 'Zombie' 'Ninja' pattern: AdjNoun: 075 VerbingNoun: 025 ; // Prints out the new username, rendered using `data`.console;
Alternatives
- randomuser.me - A fantastic service with the same purpose. The only reason this module exists is because I wanted the same simple, useful feature offline. I also didn't need some of the features, like the profile picture. If you're looking for more fields and don't need to run your tests offline, use this service.