harfiyya
v0.1.0
Published
Arabic → Latin transliteration (English & French styles) for fully vocalized Arabic text — tajweed-aware: wasl, madd, sun-letter assimilation, Allah lafz, pausal forms
Maintainers
Readme
harfiyya — حرفيّة
Arabic → Latin transliteration for fully vocalized Arabic text.
Supports English-style (sh, u, j) and French-style (ch, ou, dj) output.
Handles: harakat & tanween, shadda, madd (long vowels), sun-letter assimilation, hamzat al-wasl liaison, the lafẓ al-jalāla (الله) in all its diacritic variants, and optional pausal forms (waqf) before punctuation and at end of text.
Install
pnpm add harfiyyaUsage
import { transliterateArabic } from "harfiyya";
transliterateArabic("السَّلَامُ عَلَيْكُمْ");
// → "assalâmu ʿalaykum"
transliterateArabic("بِسْمِ اللهِ الرَّحْمٰنِ الرَّحِيمِ", "fr", { pausal: true });
// → "bismillahirraḥmânirraḥîm"API
transliterateArabic(text: string, lang?: "en" | "fr", options?: { pausal?: boolean }): string
lang— output style, default"en".options.pausal— apply waqf (drop final short vowels / convert tanween) before pauses (،,*{}and end of text). Recommended for recited texts.
Input must carry full tashkeel — unvocalized consonants come out without vowels.
License
MIT
