JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q25250F
  • License MIT

Fake data generator for Persian developers

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (chertoperter) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    فارسی |

    Chertoperter 📦

    Chertoperter is a modern, Persian-friendly alternative to Faker.js. It provides a collection of utilities for generating random yet meaningful Persian data, including names, phone numbers, dates, addresses, codes, and even swear words. Perfect for testing applications and seeding databases with Persian content. 🚀

    Features ✨

    • Random Persian Names (First Name, Last Name, Full Name, Username)
    • 📞 Fake Phone Numbers (Landline & Cellphone)
    • 📅 Persian Date Generator (Day, Month, Year, Full Date)
    • 📍 Realistic Addresses (Province, Place, Alley, Square, Full Address)
    • 🔢 Randomized Codes (Person & Company National Codes)
    • 🤬 Swear Words Generator (Polite & Impolite)
    • Lightweight & Fast (Optimized utilities for quick data generation)

    Installation ⬇️

    Install chertoperter via npm:

    npm install chertoperter

    or with yarn:

    yarn add chertoperter

    Usage 🚀

    Import the desired modules and start generating fake Persian data:

    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 📚

    person()

    Generate random Persian names and ages.

    const name = person();
    name.firstName();  // "حسین"
    name.lastName();   // "احمدی"
    name.fullName();   // "حسین احمدی"
    name.userName();   // "h.ahmadi"
    name.age(18, 60);  // 42

    phone()

    Generate fake Persian phone numbers.

    const phoneNumber = phone();
    phoneNumber.Cellphone(); // "09123456789"
    phoneNumber.Landline();  // "02112345678"

    date()

    Generate random Persian calendar dates.

    const randomDate = date();
    randomDate.day();      // "یکشنبه"
    randomDate.month();    // "فروردین"
    randomDate.year();     // 1402
    randomDate.fullDate(); // "1402/01/25"

    address()

    Generate random Persian addresses.

    const fakeAddress = address();
    fakeAddress.province();   // "تهران"
    fakeAddress.place();      // "دانشگاه تهران"
    fakeAddress.alley();      // "شهید بهشتی"
    fakeAddress.fullAddress(); // "تهران، میدان انقلاب، کوچه شهید بهشتی، پلاک 18"

    code()

    Generate random national and company codes.

    const codes = code();
    codes.personNationalCode();   // "0065432987"
    codes.companyNationalCode();  // "12345678901"
    codes.random(8);              // "83467291"

    swear()

    Generate random polite or impolite Persian swear words.

    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.
    5. Open a Pull Request.

    License 📄

    chertoperter is open-source and licensed under the MIT License.


    Made with ❤️ for the Persian developer community! 🚀