Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

node-randomuser

danielyewright13MIT1.0.2

A randomuser.me API Node.js Utility

random, generator, randomuser, json, user, data

readme

node-randomuser

A randomuser.me API Node.js Utility

view on npm npm module downloads per month Build Status Dependency Status

Installation

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

Usage

Require module and initialize client

var RandomUser = require('node-randomuser');
var randomUser = new RandomUser();

.getUsers(callback)

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

.getUsers(params, callback)

randomUser.getUsers({nat: 'us', results: 5}, function(data) {
  console.log(data);
});

Parameters (params)

  • results - specifies the number of results to return
  • nat - specifies the nationality to use

Read randomuser's API Documentation for more options.

Testing

To run the mocha.js test cases:

$ npm test

Contributing

Feel free to contribute!