A randomuser.me API Node.js Utility
Install using the node.js package manager npm:
$ npm install node-randomuser
Or install via git clone:
$ git clone https://github.com/danielyewright/node-randomuser.git
$ cd node-randomuser
$ npm install
var RandomUser = require('node-randomuser');
var randomUser = new RandomUser();
randomUser.getUsers(function(data) {
console.log(data);
});
randomUser.getUsers({nat: 'us', results: 5}, function(data) {
console.log(data);
});
results
- specifies the number of results to returnnat
- specifies the nationality to use
Read randomuser's API Documentation for more options.
To run the mocha.js test cases:
$ npm test
Feel free to contribute!