Fake data generator for Persian developers
npm install chertoperter
فارسی |
bash
npm install chertoperter
`
or with yarn:
`bash
yarn add chertoperter
`
Usage 🚀
Import the desired modules and start generating fake Persian data:
`ts
import { person, phone, date, address, code, swear } from "chertoperter";
// Generate a random Persian full name
const fullName = person().fullName();
console.log(fullName); // "امیر علی محمدی"
// Generate a fake Iranian cellphone number
const mobile = phone().Cellphone();
console.log(mobile); // "09121234567"
// Generate a random Persian date
const randomDate = date().fullDate("TITLE");
console.log(randomDate); // "شنبه 25 بهمن 1402"
// Generate a random Persian address
const fakeAddress = address().fullAddress();
console.log(fakeAddress); // "تهران، میدان آزادی، جنب دانشگاه تهران، پلاک 42"
// Generate a national code
const nationalCode = code().personNationalCode();
console.log(nationalCode); // "0012345678"
// Generate a random Persian curse word
const badWord = swear().impolite();
console.log(badWord); // "فلان فلان شده"
`
API Reference 📚
$3
Generate random Persian names and ages.
`ts
const name = person();
name.firstName(); // "حسین"
name.lastName(); // "احمدی"
name.fullName(); // "حسین احمدی"
name.userName(); // "h.ahmadi"
name.age(18, 60); // 42
`
$3
Generate fake Persian phone numbers.
`ts
const phoneNumber = phone();
phoneNumber.Cellphone(); // "09123456789"
phoneNumber.Landline(); // "02112345678"
`
$3
Generate random Persian calendar dates.
`ts
const randomDate = date();
randomDate.day(); // "یکشنبه"
randomDate.month(); // "فروردین"
randomDate.year(); // 1402
randomDate.fullDate(); // "1402/01/25"
`
$3
Generate random Persian addresses.
`ts
const fakeAddress = address();
fakeAddress.province(); // "تهران"
fakeAddress.place(); // "دانشگاه تهران"
fakeAddress.alley(); // "شهید بهشتی"
fakeAddress.fullAddress(); // "تهران، میدان انقلاب، کوچه شهید بهشتی، پلاک 18"
`
$3
Generate random national and company codes.
`ts
const codes = code();
codes.personNationalCode(); // "0065432987"
codes.companyNationalCode(); // "12345678901"
codes.random(8); // "83467291"
`
$3
Generate random polite or impolite Persian swear words.
`ts
const badWords = swear();
badWords.polite(); // "ای بابا"
badWords.impolite(); // "فلان فلان شده"
`
Contributing 🛠
We welcome contributions! Please follow these steps:
1. Fork the repository.
2. Create a new branch: git checkout -b feature-branch.
3. Commit your changes: git commit -m "Added new feature".
4. Push to the branch: git push origin feature-branch`.