Socket
Socket
Sign inDemoInstall

new-users

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

new-users

Return a random new user


Version published
Maintainers
1
Created
Source

new-users

A straightforward and lightweight Node.js module for generating random user data using the randomuser.me REST API.

Install using the node.js package manager npm:

$ npm install new-users

Examples:

  • Demos of the module are located in: ./test
  • Example JSON output is located in: ./output

Usage

Require Module and Initialize Client

var nu = require('new-users');

Get User - GetUser will return one random user

nu.getUser(callback)

nu.getUser((data) => {
    console.log(data);
});

Get Users - GetUsers will return multiple users

nu.getUsers(params, callback)

nu.getUsers({nat: 'us,gb', pass: 'upper,18', gender: 'male', results: 3}, (data) => {
    console.log(data);
});

params {Object} Documentation

  • results - num - The number of users to return
  • genders - string - The gender to return 'male', 'female'
  • nat - string - The users nationality US, AU, BR, CA, CH, DE, DK, ES, FI, FR, GB, IE, IR, NO, NL, NZ, TR
  • pass - string - Specify password characteristics length,special,upper,lower,number

Testing

Clone the repo and run the test.js file using $ node test

$ git clone git://github.com/waltir/new-users.git
$ cd new-users
$ npm install
$ node test

Keywords

FAQs

Package last updated on 11 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc