All Projects → opencafe → persianize-node

opencafe / persianize-node

Licence: BSD-2-Clause license
Persianize is set of nodejs tools for validating and converting data to correct Persian.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to persianize-node

Natours
An awesome tour booking web app written in NodeJS, Express, MongoDB 🗽
Stars: ✭ 94 (+623.08%)
Mutual labels:  validator
KValidation
Validation library. Fluent syntax in Java, mini DSL in Kotlin
Stars: ✭ 20 (+53.85%)
Mutual labels:  validator
ird-nz
Checksum validator for New Zealand's IRD/GST number.
Stars: ✭ 15 (+15.38%)
Mutual labels:  validator
swagger-object-validator
Node-Module to validate your model against a swagger spec and receive in-depth error traces
Stars: ✭ 27 (+107.69%)
Mutual labels:  validator
validator
Yii validator library
Stars: ✭ 47 (+261.54%)
Mutual labels:  validator
validator
Inpsyde Validator library
Stars: ✭ 14 (+7.69%)
Mutual labels:  validator
codeowners-validator
The GitHub CODEOWNERS file validator
Stars: ✭ 142 (+992.31%)
Mutual labels:  validator
crystal-validator
💎 Data validation module for Crystal lang
Stars: ✭ 23 (+76.92%)
Mutual labels:  validator
typepy
A Python library for variable type checker/validator/converter at a run time.
Stars: ✭ 16 (+23.08%)
Mutual labels:  validator
naija-phone-number
A fast minimal module to validate Nigerian mobile phone numbers using Regular Expressions.
Stars: ✭ 43 (+230.77%)
Mutual labels:  validator
toi
A TypeScript validation library capable of inferring types
Stars: ✭ 25 (+92.31%)
Mutual labels:  validator
romans
A Simple PHP Roman Numerals Library
Stars: ✭ 40 (+207.69%)
Mutual labels:  validator
validate-framework
validate-framework:一款轻量、无依赖的 JavaScript 验证组件
Stars: ✭ 55 (+323.08%)
Mutual labels:  validator
vayder
Easy and concise validations for Express routes
Stars: ✭ 26 (+100%)
Mutual labels:  validator
schema
SpaceAPI JSON schema files.
Stars: ✭ 20 (+53.85%)
Mutual labels:  validator
formurai
Lightweight and powerfull library for declarative form validation
Stars: ✭ 49 (+276.92%)
Mutual labels:  validator
SheenValidator
Android library to make form validation easier
Stars: ✭ 29 (+123.08%)
Mutual labels:  validator
laravel-vatvalidator
Package to validate a vat id via the api of the european union (vies)
Stars: ✭ 15 (+15.38%)
Mutual labels:  validator
wily
Build Node.js APIs from the command line (Dead Project 😵)
Stars: ✭ 14 (+7.69%)
Mutual labels:  validator
govalidators
struct 验证器,内置大部分常用验证,可自定义
Stars: ✭ 56 (+330.77%)
Mutual labels:  validator

persianize-node

NPM version Build Status Downloads

Persianize is set of nodejs tools for validating and converting data in correct Persian.

Installation

Via npm

If you have a package.json file in your directory you can require the package and run npm install

{
    "name": "persianize",
    "version": "2.0.0"
}

Or run following command to direct usage

npm install persianize

Manual installation

If you didn't use dependency management systems you can install persianize in manual way, download ZIP file and then extract it and all you need is require 'Persianize.js' file on your project and use it.

Import

You can use both persianize validator and convert in one single object, like every node module you should import this package to your file.

var persianize = require('persianize');

Convert

This object helps you to change phrases to right Persian

Number

Convert English and Arabic numbers to right Persian numbers.

persianize.convert().number('0123456789').get(); // Output --> ۰۱۲۳۴۵۶۷۸۹

Remove Arabic character

Remove Arabic keyboard characters from Persian text.

persianize.convert().removeArabicChar('فارسي').get(); // Output --> فارسی

Replace space with half-space

Detect persian verbs and replace space with half-space

persianize.convert().halfSpace('می روی').get(); // Output --> می‌روی

Full Convert

This method will convert number, convert arabic characters to Persian and replace space with half-space.

persianize.convert().all('فارسي 1').get(); // Output --> فارسی ۱

Validate

Validating Persian language inputs like Persian number, Persian alphabet...

Alphabel

Validate Persian Alphabet

persianize.validator().alpha('فارسی'); // Output --> TRUE

Number

Validate Persian Number

persianize.validator().number('۱۲۳'); // Output --> TRUE

Alpha_Num

Validate Persian Alphabet and numbers

persianize.validator().alphaNum('۳فارسی'); //Output --> TRUE

Text

Validate Persian alphabet, numbers, space, half-space and special characters.

persianize.validator().text('۳ فارسی') //Output --> TRUE

Mobile

Validate Iran mobile number.

persianize.validator().mobile('09355555555') //Output --> TRUE

Crad_Number

Validate Iran crad number.

persianize.validator().cradNumber('6274129005473742') //Output --> TRUE

Phone

Validate Iran phone number.

persianize.validator().phone('37236445') //Output --> TRUE

Postal_Code

Validate Iran postal code.

persianize.validator().postalCode('1619735744') //Output --> TRUE

Sheba

Validate Iran sheba number.

persianize.validator().sheba('IR062960000000100324200001') //Output --> TRUE

Meli_Code

Validate Iran meli code.

persianize.validator().meliCode('0013542419') //Output --> TRUE
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].