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

arabic-text-tools

v1.0.2

Published

Dependency-light Arabic text normalization and developer utilities for TypeScript.

Readme

arabic-text-tools

العربية

npm version CI

مكتبة TypeScript خفيفة لاعتماد أقل، مخصّصة لتطبيع النص العربي، والمطابقة في البحث، وتحويل الأرقام، واكتشاف الاتجاه، وتطبيع صوتي محدود.

لماذا هذه المكتبة؟

غالبًا تحتاج التطبيقات العربية إلى مطابقة ثابتة عبر التشكيل، وأشكال الهمزة، والتطويل، وعلامات الاتجاه ثنائي الاتجاه، والأرقام العربية الهندية. توفّر arabic-text-tools أدوات صغيرة ودوال نقية لهذه المهام المتكررة من دون إدخال اعتمادات ثقيلة.

التثبيت

npm install arabic-text-tools

مثال سريع

import { normalizeForSearch, detectDirection, toArabicDigits } from 'arabic-text-tools';

normalizeForSearch('السَّلَامُ عَلَيْكُمْ');
// "السلام عليكم"

detectDirection('مرحبا');
// "rtl"

toArabicDigits(2025);
// "٢٠٢٥"

ميزات الإصدار الأول

  • تطبيع عربي لتنظيف آمن للعرض.
  • تطبيع للبحث من أجل المقارنة والفهرسة.
  • تحويل الأرقام العربية الهندية والفارسية.
  • اكتشاف الاتجاه لدعم RTL/LTR.
  • تطبيع صوتي محدود لحالات الاستخدام الشائعة عند المطوّرين.

الواجهة البرمجية

  • normalizeArabic(text, options) — تطبيع النص العربي مع إعدادات تنظيف قابلة للتخصيص.
  • stripDiacritics(text) — إزالة الحركات وبعض العلامات القرآنية/العربية.
  • normalizeForSearch(text, options) — تطبيع أكثر صرامة للمطابقة.
  • detectDirection(text) — اكتشاف rtl أو ltr.
  • toArabicDigits(value) — تحويل الأرقام 0–9 إلى أرقام عربية هندية.
  • toLatinDigits(value) — تحويل الأرقام العربية الهندية أو الفارسية إلى أرقام لاتينية.
  • transliterateArabic(text, options) — تطبيع صوتي محدود وبحذر مقصود.

فلسفة التطبيع

لا توجد قاعدة واحدة شاملة لتطبيع العربية تناسب كل تطبيق. هذه الحزمة تفصل بين تنظيف آمن للعرض وتطبيع آمن للبحث، حتى تختار السلوك المناسب لاستخدامك.

ملاحظات

  • التحويل الصوتي محدود عمدًا في الإصدار الأول.
  • قد يقلل normalizeForSearch من قابلية الاسترجاع العكسي.
  • تختلف قواعد التطبيع العربية حسب المنطقة والمجال، لذلك تبقى الخيارات صريحة وواضحة.

التطوير

npm install
npm test
npm run build

الإصدار

استخدم Conventional Commits واصدر من main بعد نجاح CI.

الترخيص

MIT — راجع LICENSE.

English

npm version CI

A dependency-light TypeScript library for Arabic text normalization, search matching, digit conversion, direction detection, and limited transliteration.

Why this exists

Arabic apps often need consistent matching across diacritics, hamza forms, tatweel, bidi marks, and Arabic-Indic digits. arabic-text-tools gives you a small, pure-function toolkit for those repeated problems without pulling in heavy dependencies.

Install

npm install arabic-text-tools

Quick example

import { normalizeForSearch, detectDirection, toArabicDigits } from 'arabic-text-tools';

normalizeForSearch('السَّلَامُ عَلَيْكُمْ');
// "السلام عليكم"

detectDirection('مرحبا');
// "rtl"

toArabicDigits(2025);
// "٢٠٢٥"

v1 features

  • Arabic normalization for display-safe cleanup.
  • Search normalization for comparisons and indexing.
  • Arabic-Indic and Persian digit conversion.
  • Direction detection for RTL/LTR handling.
  • Limited transliteration for common developer use cases.

API

  • normalizeArabic(text, options) — normalize Arabic text with configurable cleanup.
  • stripDiacritics(text) — remove harakat and Quranic/Arabic diacritics.
  • normalizeForSearch(text, options) — aggressive normalization for matching.
  • detectDirection(text) — detect rtl or ltr.
  • toArabicDigits(value) — convert 0–9 to Arabic-Indic digits.
  • toLatinDigits(value) — convert Arabic-Indic or Persian digits to Latin digits.
  • transliterateArabic(text, options) — limited transliteration, intentionally conservative.

Normalization philosophy

There is no single universal Arabic normalization rule for every app. This package separates display-safe cleanup from search-safe normalization so you can choose the right behavior for your use case.

Caveats

  • Transliteration is intentionally limited in v1.
  • normalizeForSearch may reduce reversibility.
  • Arabic normalization rules can vary by region and domain, so the options stay explicit.

Development

npm install
npm test
npm run build

Release

Use conventional commits and release from main after CI passes.

License

MIT — see LICENSE.