npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

persian-names

v1.1.3

Published

Package of all Iranian (and Arabic) names

Readme

Persian FirstName (JSON) 🇮🇷

Package of all Iranian (and Arabic) names

پکیج تمامی اسامی ایرانی (و عربی)

Using:

install:

npm install persian-names
yarn install persian-names

import:

import { PersianNames } from 'persian-names';

require:

const { PersianNames } = require('persian-names');

new class:

const persianName = new PersianNames(); //using default json file

const persianName = new PersianNames('./assets/firstname.json'); //using custom json

Examples

Validation Persian Name:

const is_name = persianName.validation('آرش');
console.log(is_name); //true  or  false

using options

const is_name = persianName.validation('امیر', {
  convertToPersian: true,
  typeCheck: 'exact',
  trimName: true,
});
console.log(is_name); //true  or  false

Get All FirstName:

const get_names = persianName.getNames();
console.log(get_names);

/*
[
   { id: 1, name: 'اَبدەَ', gender: 1, rate: 3 },
   { id: 2, name: 'اَبیش', gender: 1, rate: 3 },
   ...
]
*/

using options:

const get_names = persianName.getNames({
  genderType: 'stringFa',
  rateType: 'stringFa',
  getParamsData: {
    id: false,
    name: true,
    gender: true,
    rate: true,
  },
});
console.log(get_names);
/*
[
    { name: 'اَبدەَ', gender: 'مرد', rate: 'بسیار نادر' }
   { name: 'اَبیش', gender: 'مرد', rate: 'بسیار نادر' },
   ...
]
*/

Find Name:

const find_name = persianName.findName('زهرا');
console.log(find_name);
// return { id: 2887, name: 'زهرا', gender: 2, rate: 1 }

using options:

const find_name = persianName.findName('علی', {
  myTypeGender: {
    male: 'مردانه',
  },
  typeCheck: 'include',
});

Get Gender Name:

const get_gender_name = persianName.getGenderName('سارا', {
  genderType: 'stringFa',
});
console.log(get_gender_name);
// return { gender: 'زن' }

Include Name:

const include_name = persianName.includeName(
  'سلام من رضا هستم به همراه علی و احمد',
  {
    // options
  }
);
console.log(include_name);
/**  return {
  originalStr: 'سلام من رضا هستم به همراه علی و احمد',
  findNamesToStr: 'سلام من "رضا" هستم به همراه "علی" و "احمد"',
  names: [
    { id: 634, name: 'احمد', gender: 'male', rate: 1 },
    { id: 2399, name: 'رضا', gender: 'male', rate: 1 },
    { id: 3652, name: 'علی', gender: 'male', rate: 1 }
  ],
  length: 3
}
*/

options:

| Options | Description | type support | Default | | :--------------: | :--------------------------------------------------------------------------------: | :-------------------------------------------------------: | :--------------: | | convertToPersian | convert alphabet arabic to persian | boolean,undefined | false | | typeCheck | include type or exact type for find name | 'exact','include' | exact | | trimName | trim name before validation (remove space and A-Z characters and emojis and ...) | boolean,undefined | false | | myTypeGender | custom gender (male,female,both) show in result | undefined, male:string, female:string, both:string, | undefined | | genderType | convert gender name for show | undefined, genderTypeFa, genderTypeNumber, genderTypeArb, | genderTypeNumber | | rateType | convert rate name for show | undefined, rateTypeNumber, rateTypeFa | rateTypeNumber | | getParamsData | items that can be displayed in the output | undefined, id:bool, name:bool, gender:bool, rate:bool, | undefined |

Rate Types:

| value | number | stringFa | | :-------: | :--------: | :----------: | | 1 | 1 | پر کاربردی | | 2 | 2 | معمولی | | 3 | 3 | بسیار نادر |

Gender Types:

| value | Number | Fa | Arb | | :-------: | :--------: | :----: | :-----: | | 1 | 1 | مرد | مذکر | | 2 | 2 | زن | مونث | | 3 | 3 | هردو | هردو |

نکات

1- ممکن است یک سری از نام ها در این کتابخانه وجود نداشته باشد. که شما می توانید از طریق این لینک پروژه تبدیل کننده آن را دریافت کنید: project که این پروژه شامل فایل اکسل آماده اسامی + کد های جاوااسکریپت برای تبدیل فایل اکسل به json است.

2- بعضی از اسامی مانند حشمت و یا احسان و... هم در مردان و هم در زنان استفاده می شود پس این کتابخانه در جواب آن به شما پاسخ 3 و یا هردو و... میدهد.

3-این کتابخانه برای سهولت در توسعه و کار کردن با آن از دیتابیس داخلی یعنی json استفاده می کند.

4- این کتابخانه تا به الان شامل 6179 عدد نام مرد و زن (عربی و فارسی) است.

5- نام هایی مثل محمد و محمدرضا و یا محمدمهدی جدا هستند و جدا حساب می شوند.


مشتاق به دریافت پیشنهادات و نظرات دوستان هستم.

✉️ email : [email protected]

🌐 github : https://github.com/mohammadhejazirad