0.0.5 • Published 1 year ago

dummy-user-json v0.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

dummy-users-json

npm version

šŸŽ‰ Generate dummy user data with ease! dummy-users-json is a lightweight npm package that provides functions to generate dummy user data in JSON format. Perfect for testing and prototyping applications without the need for real user data.

Installation

To install dummy-users-json, use npm or yarn:

npm install dummy-users-json

or

yarn add dummy-users-json

Usage

const dummyUsers = require("dummy-users-json");

// Generate 10 dummy users

const users = dummyUsers.generateUniqueUsers(10);
console.log(users);

Example Output

[
  {
    "id": 0,
    "fname": "John",
    "lname": "Doe",
    "email": "john.doe@dummy.com",
    "job": "Software Engineer"
  },
  {
    "id": 1,
    "fname": "Jane",
    "lname": "Smith",
    "email": "jane.smith@dummy.com",
    "job": "Data Analyst"
  }
  // More users...
]

API

generateUsers(count: number): User[]

Generates an array of dummy users.

  • count: The number of users to generate.

Returns an array of user objects.

User Object

  • id: Unique identifier for the user.
  • fname: First name of the user.
  • lname: Last name of the user.
  • email: Email address of the user (generated from first name and last name).
  • job: Job title of the user (randomly selected from a predefined list).

Comparison Table

Featuresdummy-users-jsonOther Tools
Ease of Useāœ…āŒ
Offline Usageāœ…āŒ
Unique Results300Varies
TypeScript Readyāœ…Varies

Additional Information

  • This package can generate up to 300 unique results.
  • No internet connection is required to fetch data; it mocks API calls due to its asynchronous nature.
  • Developed in TypeScript, enabling auto-suggestion features.

License

This project is licensed under the MIT License - see the LICENSE file for details.