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 🙏

© 2024 – Pkg Stats / Ryan Hefner

angular2-persian-pipes

v0.0.6

Published

Persian pipes for Angular2 applications.

Downloads

12

Readme

Angular2PersianPipes

Persian pipes for Angular2 apps.

Install

npm

npm install angular2-persian-pipes --save

Usage

Import PersianPipesModule into your app's modules:

import {PersianPipesModule} from 'angular2-persian-pipes'

@NgModule({
  imports: [
    PersianPipesModule
  ]
})

This makes all the angular2-persian-pipes pipes available for use in your app.

IsPerNumberPipe

This pipe take a Template expressions and check it is persian number?

Example
<h3>{{1234567890 | isPerNumber}}</h3>   <!--output: false-->
<h3>{{'1234567890' | isPerNumber}}</h3> <!--output: false-->
<h3>{{'1۱2۲3۳4۴5۵6۶7۷8۸9۹0۰' | isPerNumber}}</h3> <!--output: false-->
<!-- ۱۲۳٤٥٦۷۸۹۰ is arabic number. -->
<h3>{{'۱۲۳٤٥٦۷۸۹۰' | isPerNumber}}</h3>   <!--output: false-->
<h3>{{'۱۲۳۴۵۶۷۸۹۰' | isPerNumber}}</h3>   <!--output: true-->

PerNumberPipe

This pipe take a Template expressions and convert to persian digits.

Example
<h3>{{'12345679' | perNumber}}</h3> <!--output: ۱۲۳۴۵۶۷۹-->

PerToEngNumberPipe

This pipe take a Template expressions and convert to english number.

Example
<h3>{{'1234567890' | perToEngNumber}}</h3>  <!--output: 1234567890-->
<h3>{{'۱۲۳۴۵۶۷۸۹۰' | perToEngNumber}}</h3>  <!--output: 1234567890-->
<!-- this pipe just persian number to english number and arabic number not suported this pipe. -->
<h3>{{'۱۲۳٤٥٦۷۸۹۰' | perToEngNumber}}</h3>  <!--output: 0-->

NumToPerWord

This pipe take a Template expressions and convert to persian word.

Example
  <h3>{{'1234567890' | numToPerWord}}</h3>  <!--output: یک میلیارد و دویست و سی و چهار میلیون و پانصد و شصت و هفت هزار و هشتصد و نود-->
  <h3>{{'۱۲۳۴۵۶۷۸۹۰' | numToPerWord}}</h3>  <!--output: یک میلیارد و دویست و سی و چهار میلیون و پانصد و شصت و هفت هزار و هشتصد و نود-->
  <h3>{{'۱۲۳٤٥٦۷۸۹۰' | numToPerWord}}</h3>  <!--output: ۱۲۳٤٥٦۷۸۹۰ is not valid number! -->
  <h3>{{1234567890 | numToPerWord}}</h3>  <!--output: یک میلیارد و دویست و سی و چهار میلیون و پانصد و شصت و هفت هزار و هشتصد و نود-->

SafePerWord

This pipe take a 'string' and replace all arabic letters with persian(e.g 'ي' and 'ك' replace with 'ی' and 'ک').

Example
  <h3>{{'انگولار يك فريمورك ساختاري براي وب اپليكيشن هاي پويا است.' | safePerWord}}</h3> <!--output: انگولار یک فریمورک ساختاری برای وب اپلیکیشن های پویا است.-->
  <h3>{{'Angular يك فريمورك ساختاري براي وب اپليكيشن هاي پويا است.' | safePerWord}}</h3> <!--output: Angular یک فریمورک ساختاری برای وب اپلیکیشن های پویا است.-->

IsNationalCode

This pipe take a 'nationalCode' and check it is correctly?

nationalCode >> شماره ملی

Example
  <h3>{{'0082959277' | isNationalCode}}</h3>  <!--output: true-->
  <h3>{{'۰۰۸۲۹۵۹۲۷۷' | isNationalCode}}</h3>  <!--output: true-->
  <h3>{{'۰۰۸۲۹٥۹۲۷۷' | isNationalCode}}</h3>  <!--output: false-->
  <h3>{{0082959277 | isNationalCode}}</h3>  <!--output: true-->

IsCompanyNationalId

This pipe take a 'CompanyNationalId' and check it is correctly?

CompanyNationalId >> شناسه ملی شرکت

Example
  <h3>{{'10260595692' | isCompanyNationalId}}</h3>  <!--output: true-->
  <h3>{{'۱۰۲۶۰۵۹۵۶۹۲' | isCompanyNationalId}}</h3>  <!--output: true-->
  <h3>{{'۱۰۲۶۰٥۹٥۶۹۲' | isCompanyNationalId}}</h3>  <!--output: false-->
  <h3>{{10260595692 | isCompanyNationalId}}</h3>  <!--output: true-->

License

MIT