
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
persian-firstname
Advanced tools
Package of all Iranian (and Arabic) names
پکیج تمامی اسامی ایرانی (و عربی)
install:
npm install persian-firstname
yarn install persian-firstname
import:
import PersianName from 'persian-firstname';
require:
const PersianName = require('persian-firstname').default;
Validation Persian Name:
const is_name = PersianName.validation('آرش');
console.log(is_name); //true or false
using options
const is_name = PersianName.validation('امیر', {
convertToPersian: true, // ي ==> ی (using package @persian-tools)
typeCheck: 'exact', //include type or exact type for find name
trimName: true, //trim name before validation (remove space and A-Z characters and emojis and ...)
});
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', // default is "number" => or using myTypeGender,
rateType: 'stringFa', // default is "number"
getParamsData: {
// return param data
//default is true
id: false,
name: true,
gender: true,
rate: true,
},
limitation: {
limit: 100,
offset: 10,
},
});
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('علی', {
// previous duplicate options
showErrorMessage: true, //if not find name return (*name*) find name //default: false
consoleLog: true, //default: false //if not find name sow console log (*name*) find name
});
Get Gender Name:
const get_gender_name = PersianName.getGenderName('سارا', {
// previous duplicate options
genderType: 'stringFa',
});
console.log(get_gender_name);
// return { gender: 'زن' }
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, genderTypeEn, genderTypeFa, genderTypeNumber, genderTypeEmoji, genderTypeArb, | genderTypeNumber |
rateType | convert rate name for show | undefined, rateTypeNumber, rateTypeEn, rateTypeFa | rateTypeNumber |
getParamsData | items that can be displayed in the output | undefined, id:bool, name:bool, gender:bool, rate:bool, | undefined |
showErrorMessage | if not find name => (name) not found name | boolean,undefined | false |
consoleLog | if not find name sow console log (name) find name | boolean,undefined | false |
limitation | limit for show names | undefined, limit:number, offset:number | undefined |
Rate Types:
value | stringEn type | number type | stringFa type |
---|---|---|---|
1 | very practical | 1 | پر کاربردی |
2 | normal | 2 | معمولی |
3 | very rare | 3 | بسیار نادر |
Gender Types:
value | genderTypeEn | genderTypeFa | genderTypeFa2 | genderTypeNumber | genderTypeEmoji | genderTypeArb |
---|---|---|---|---|---|---|
1 | Male | مرد | آقا | 1 | ♂️ | مذکر |
2 | Female | زن | خانم | 2 | ♀️ | مونت |
3 | Both | هر دو | هر دو | 3 | ♂️♀️ | هر دو |
1- Added myTypeGender option
2- Change Name Method validationPersianName to validation
3- Added options limitation for getNames method
4- remove method randomName
5- update documentation
1- ممکن است یک سری از نام ها در این کتابخانه وجود نداشته باشد. که شما می توانید از طریق این لینک پروژه تبدیل کننده آن را دریافت کنید: project که این پروژه شامل فایل اکسل آماده اسامی + کد های جاوااسکریپت برای تبدیل فایل اکسل به sqlite است.
2- بعضی از اسامی مانند حشمت و یا احسان و... هم در مردان و هم در زنان استفاده می شود پس این کتابخانه در جواب آن به شما پاسخ 3 و یا هردو و... میدهد.
3-این کتابخانه برای سهولت در توسعه و کار کردن با آن از دیتابیس داخلی یعنی sqlite استفاده می کند.
4- این کتابخانه تا به الان شامل 6179 عدد نام مرد و زن (عربی و فارسی) است.
5- نام هایی مثل محمد و محمدرضا و یا محمدمهدی جدا هستند و جدا حساب می شوند.
FAQs
Package of all Iranian (and Arabic) names
The npm package persian-firstname receives a total of 4 weekly downloads. As such, persian-firstname popularity was classified as not popular.
We found that persian-firstname demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.