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

persian-utilities

v1.1.1

Published

Persian utilities using for persian application lang UTF8

Downloads

24

Readme

persian-utilities

alt text

License: MIT

Persian Modules need to Improved Application. Collections of Persian Utils And Helpers Function.

Collections

Install

NPM

npm install persian-utilities

Usage

Import persian-utilities into your app's modules or import ES modules With Name

Apis

convertDigitsFaToEn

import { convertDigitsFaToEn } from 'persian-utilities';
convertDigitsFaToEn('۱۲۳۴'); // result : 1234

convertDigitsEnToFa

import { convertDigitsEnToFa } from 'persian-utilities';
convertDigitsEnToFa('1234'); // result : ۱۲۳۴

persianCardValidation

import { persianCardValidation } from 'persian-utilities';
persianCardValidation('6219861054512345'); // result : {bankName : "بانک سامان" , isValid : true}

timeAgo

second argument set Exact option

import { timeAgo } from 'persian-utilities';
// not exact mode
timeAgo('۱۴۰۱/۰۵/۰۹ ۱۰:۰۰'); // result : روز قبل 1
// exact mode
timeAgo('۱۴۰۱/۰۵/۰۹ ۱۰:۰۰', true); // result : ثانیه29 و ساعت2 و روز1

isNationalID

import { isNationalID } from 'persian-utilities';
isNationalID('1111111111'); // result : true

numericalSeparator

import { numericalSeparator } from 'persian-utilities';
numericalSeparator(entryNumber, separateLength?: number, separator?: string)
import { numericalSeparator } from 'persian-utilities';
// without Passing Any Option
numericalSeparator(100000); // result : 100,000
// with Customized options
numericalSeparator('10000', 2, '.'); // result : 1.00.00

numericalSeparator Arguments

| index | argument | type | default value | | ----- | ------------------------- | ---------------- | ------------- | | 1 | entryNumber | string or number | - | | 2 | separateLength (optional) | number | 3 | | 3 | separator (optional) | string | "," |

numericalWithoutSeparator

import { numericalWithoutSeparator } from 'persian-utilities';
numericalWithoutSeparator(numberWithSeparator: string, separator?: string)
import { numericalWithoutSeparator } from 'persian-utilities';
// without Passing Any Option
numericalWithoutSeparator(100000); // result : 100,000
// with Customized options
numericalWithoutSeparator(1.00.00 , "."); // result : 10000

wordifynumbers

We Supported Entry Number Less Than 1 Trillion

import { wordifynumbers } from 'persian-utilities';
wordifynumbers(5620); // result : پنج هزار و ششصد و بیست
wordifyNumbers(153000); // result : یکصد و پنجاه و سه هزار
wordifyNumbers('۵۲۴۴۲۴۴۳۶۰۰'); // result : پنجاه و دو میلیارد و چهارصد و چهل و دو میلیون و چهارصد و چهل و سه هزار و ششصد

abbNumber

Convert long number into abbreviated string

import { abbNumber } from 'persian-utilities';
abbNumber(5620); // result : "5K"
abbNumber(1530000); // result : "1M"    
abbNumber(52100000,1); // result : "52.1M"

Large number abbreviations

| number | abbr | name | | -------------------- | ------ | ------ | | >10^3 | K | kilo | | >10^6 | M | mega | | >10^9 | G | giga | | >10^12 | T | tera | | >10^15 | P | peta | | >10^18 | E | exa |