A randomuser.me API Node.js Utility
Install using the node.js package manager npm:
$ npm install node-randomuserOr install via git clone:
$ git clone https://github.com/danielyewright/node-randomuser.git
$ cd node-randomuser
$ npm installvar 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 testFeel free to contribute!