faking-details
v1.0.2
Published
Fake Data Generator is a simple and lightweight NPM package designed for developers who need fake data for testing or seeding databases. The package includes functions for generating random names, email addresses, and fake card details.
Downloads
106
Maintainers
Keywords
Readme
Fake Data Generator
Overview
Fake Data Generator is a simple and lightweight NPM package designed for developers who need fake data for testing or seeding databases. The package includes functions for generating random names, email addresses, and fake card details.
Features
- Generate realistic names (first name, last name, and full name).
- Generate random but realistic email addresses.
- Generate fake credit card details (card number, CVV, expiry date, and more).
Installation
Install the package using npm:
npm install faking-details
or with yarn:
yarn add faking-details
Usage
Importing the Package
const { fake_email, fake_name, fake_card_details } = require('faking-details');
Generating Fake Email
const email = fake_email();
console.log(email); // e.g., [email protected]
Generating Fake Name
const name = fake_name();
console.log(name);
// Output:
// {
// full_Name: 'Sophia Johnson',
// first_name: 'Sophia',
// last_name: 'Johnson'
// }
Generating Fake Card Details
const cardDetails = fake_card_details();
console.log(cardDetails);
// Output:
// {
// name: { full_Name: 'Lucas Brown', first_name: 'Lucas', last_name: 'Brown' },
// password: '1234',
// expiry_date: '03/2029',
// cvv: '567',
// card_number: '123456789012345'
// }
API Reference
fake_email()
Generates a random email address using a realistic name.
Returns:
A string representing an email address.
Example: [email protected]
.
fake_name()
Generates a random name.
Returns:
An object containing:
full_Name
: Full name as a single string.first_name
: First name.last_name
: Last name.
fake_card_details()
Generates fake credit card details.
Returns:
An object containing:
name
: An object with the user's full name, first name, and last name.password
: A 4-digit random password.expiry_date
: A random expiry date inMM/YYYY
format.cvv
: A 3-digit CVV code.card_number
: A 15-digit card number.