/randomuser

A (tiny) Node.js client for https://randomuser.me/ REST API

Primary LanguageTypeScriptMIT LicenseMIT

randomuser

CI npm version

Installation

Install using the node.js package manager npm:

$ npm install randomuser

Examples

Demos of the randomuser module are located in: ./examples

Usage

Require Module and Initialize Client

var RandomUser = require('randomuser')
  , r = new RandomUser();

.getUsers(callback)

r.getUsers(function(data) {
  console.log(data);
});

.getUsers(params, callback)

r.getUsers({ seed: "foxie", results: 5, gender: "male" }, function(data) {
  console.log(data);
});

params {Object} Documentation

  • results - int specifying number of results to return
  • genders - string - "male" or "female" specifying gender to generate
  • seed - string - service will return same data for given seed

Testing

$ npm test

Contributing

Feel free to contribute!