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

@0x0645/tafqit

v1.0.0

Published

TypeScript Arabic tafqit/tafqeet package with grammatical rules, currencies, and counted nouns.

Readme

Arabic number-to-words for TypeScript with grammar-aware counted nouns, currencies, and quantity conversion.

Tafqit

@0x0645/tafqit converts numbers into Arabic words with support for grammatical gender, i'rab-sensitive forms, counted nouns, legal phrasing, currencies, and decimal quantities that can decompose into smaller units such as ريال/هللة, متر مربع/سنتيمتر مربع, or ساعة/دقيقة.

Features

  • Integer tafqit() for plain Arabic number spelling.
  • tafqitWithSubject() for counted nouns like طالب, صندوق, or مستخدم.
  • tafqitDecimal() and tafqitQuantity() for currencies and measurable units.
  • Typed subjects registry with English camelCase keys and Arabic labels.
  • Built-in support for Arabic currencies, world currencies, digital currencies, measures, areas, time, trade units, and people/technology nouns.
  • Quantity conversion metadata for units such as ساعة -> دقيقة, متر مربع -> سنتيمتر مربع, and كيلومتر في الساعة -> متر في الساعة.
  • Customizable decimal separator text, legal wrapping, scale naming, and formatting switches.

Install

pnpm add @0x0645/tafqit

Quick Start

import { tafqit } from "@0x0645/tafqit";

tafqit(2000);
// ألفان

tafqit(12, { gender: "feminine" });
// اثنتا عشرة

tafqit(122, { grammaticalCase: "accusative" });
// مائة واثنين وعشرين

tafqit(2000, { textToFollow: true });
// ألفا

Counted Nouns

import { subjects, tafqitWithSubject } from "@0x0645/tafqit";

tafqitWithSubject(1, subjects.student);
// طالب واحد

tafqitWithSubject(3, subjects.student);
// ثلاثة طلاب

tafqitWithSubject(21, subjects.student);
// واحد وعشرون طالبًا

Decimals, Currencies, and Quantities

import { subjects, tafqitDecimal, tafqitQuantity } from "@0x0645/tafqit";

tafqitDecimal("12.50", {
  subject: subjects.saudiRiyal,
  subunit: subjects.halala,
  fractionDigits: 2
});
// اثنا عشر ريالًا سعوديًا وخمسون هللةً

tafqitQuantity("140.55", {
  subject: subjects.squareMeter,
  legal: true
});
// فقط مائة وأربعون مترًا مربعًا وخمسة آلاف وخمسمائة سنتيمتر مربع لا غير

tafqitQuantity("1.5", { subject: subjects.hour });
// ساعة واحدة وثلاثون دقيقةً

Typed Registry and Reusable Formatters

import { createFormatter, subjects, tafqitQuantity } from "@0x0645/tafqit";

const sar = createFormatter({
  subject: subjects.saudiRiyal,
  subunit: subjects.halala,
  fractionDigits: 2
});

sar.decimal("12.50");
sar.integer(1250);

tafqitQuantity("10.5", { subject: subjects.kilometerPerHour });
// عشرة كيلومترات في الساعة وخمسمائة متر في الساعة

Built-in Subject Access

import { getSubject, getSubjectOrThrow, listSubjects, subjects } from "@0x0645/tafqit";

subjects.saudiRiyal;
getSubject("ريال سعودي");
getSubject("saudiRiyal");
getSubjectOrThrow("student");
listSubjects();

Package API

  • tafqit(number, options?)
  • tafqitWithSubject(number, subject, options?)
  • tafqitDecimal(value, options?)
  • tafqitQuantity(value, options?)
  • createFormatter(defaults)
  • subjects, getSubject(), getSubjectOrThrow(), safeGetSubject(), listSubjects()

Development

pnpm install
pnpm lint
pnpm check
pnpm test
pnpm build
pnpm --filter tafqit-example dev

Example App

The Next.js example playground lives in example/ and links back to the project repository:

  • Repository: https://github.com/0x0645/tafqit
  • Local run: pnpm --filter tafqit-example dev

License

MIT - see LICENSE.

Repository

  • GitHub: https://github.com/0x0645/tafqit
  • Issues: https://github.com/0x0645/tafqit/issues