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-seo

v0.1.0

Published

SEO helpers for Arabic + English websites: readable Arabic slugs, hreflang, safe JSON-LD (Person, Article, FAQ, Video), digit and tashkeel normalization. Zero dependencies.

Readme

arabic-seo

SEO helpers for Arabic + English websites. Readable Arabic slugs, hreflang tags, JSON-LD that is safe to drop into a <script> tag, and the small text fixes Arabic sites always need (digits, tashkeel, direction). Zero dependencies, works in Node, Deno, Bun, edge runtimes and the browser.

أدوات SEO للمواقع العربية والإنجليزية: روابط عربية مقروءة، hreflang، وJSON-LD آمن، وتنظيف الأرقام والتشكيل.

npm install arabic-seo

Slugs

import { slugify } from "arabic-seo";

slugify("دليل تطبيقات BYD الكامل ٢٠٢٦!");
// "دليل-تطبيقات-byd-الكامل-2026"   (tashkeel removed, digits converted)

slugify("سيارات كهربائية", { transliterate: true });
// "syarat-khrbaeya"

slugify(longTitle, { maxLength: 60 }); // cuts on a word boundary

Google reads Arabic URLs fine and browsers show them decoded, so keeping Arabic is usually the better choice for Arabic pages. Use transliterate when a platform only accepts Latin characters.

hreflang

import { hreflangLinks, hreflangHtml } from "arabic-seo";

hreflangHtml(
  { ar: "https://example.com/ar/guide", en: "https://example.com/en/guide" },
  { xDefault: "ar" },
);
// <link rel="alternate" hreflang="ar" href="https://example.com/ar/guide" />
// <link rel="alternate" hreflang="en" href="https://example.com/en/guide" />
// <link rel="alternate" hreflang="x-default" href="https://example.com/ar/guide" />

It throws on relative URLs and invalid codes, the two mistakes Search Console flags most.

JSON-LD

import { personJsonLd, articleJsonLd, faqJsonLd, videoJsonLd, jsonLdScript } from "arabic-seo";

jsonLdScript(
  personJsonLd({
    name: "Moath Alherani",
    alternateName: "معاذ الهريني",
    url: "https://moathalherani.com",
    jobTitle: "Content Creator",
  }),
);

articleJsonLd({ headline: "دليل الهوكس", datePublished: "2026-11-02", author: "Moath Alherani" });
// inLanguage is detected as "ar" automatically

videoJsonLd({ name: "…", thumbnailUrl: "https://…", uploadDate: "2026-11-02", duration: 95 }); // "PT1M35S"
faqJsonLd([{ question: "شو هو الهوك؟", answer: "أول جملة بالفيديو." }]);

Empty fields are dropped. jsonLdString and jsonLdScript escape <, >, & and line separators, so user content can never close the script tag.

Text helpers

| Function | Does | | --- | --- | | toLatinDigits("٢٠٢٦") | "2026" (also Persian digits) | | toArabicDigits("2026") | "٢٠٢٦" | | stripTashkeel(text) | removes diacritics and ـ | | normalizeArabic(text) | for search: unifies أ إ آ → ا, ة → ه, ى → ي | | detectDirection(text) | "rtl" or "ltr" from the first strong letter | | arabicRatio(text) | share of Arabic letters, 0 to 1 | | metaDescription(text, 155) | trims without cutting a word, adds … | | readingTime(text) | minutes; 180 wpm for Arabic, 230 for English |

License

MIT © Eng. Moath Alherani