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.
- 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).
Install the package using npm:
npm install faking-details
or with yarn:
yarn add faking-details
const { fake_email, fake_name, fake_card_details } = require('faking-details');
const email = fake_email();
console.log(email); // e.g., AlexanderSmith@gmail.com
const name = fake_name();
console.log(name);
// Output:
// {
// full_Name: 'Sophia Johnson',
// first_name: 'Sophia',
// last_name: 'Johnson'
// }
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'
// }
Generates a random email address using a realistic name.
Returns:
A string representing an email address.
Example: JohnDoe@gmail.com
.
Generates a random name.
Returns:
An object containing:
-
full_Name
: Full name as a single string. -
first_name
: First name. -
last_name
: Last name.
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.