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

@bakissation/houwiya

v1.1.0

Published

Validate, parse, and extract Algerian identifiers in TypeScript — NIN, NIF, NIS, RC, RIB/CCP/IBAN, CNAS — with checksums (Luhn, mod-97), wilaya extraction and entity-type detection. Zero dependencies.

Readme

@bakissation/houwiya

Validate, parse, and extract Algerian identifiers in TypeScript — NIN, NIF, NIS, RC, RIB/CCP/IBAN, CNAS. Don't just check validity: pull out exactly the part you need (the wilaya of an RC, the sex from a NIN, the account from a RIB). Zero runtime dependencies.

npm CI license

  • 🔎 Parse, don't just validate — every parse* returns a typed object you can read one field from.
  • Real checksums — NIN (Luhn), RIB / CCP / IBAN (mod-97). Structural validation for the rest.
  • 🧩 Semantic extraction — wilaya (NIF/NIS/RC/CNAS), entity type (RC A/B), sex + birth year (NIN), bank/agency/account (RIB).
  • 🇩🇿 Algeria-aware — 69 wilayas (2026 reform), Latin and Arabic input (أ/ب, Arabic-Indic digits), the CCP↔RIB "BaridiMob" bridge.
  • 🧱 Strict TypeScript, ESM + CommonJS, zero dependencies.

Install

npm install @bakissation/houwiya

Requires Node.js ≥ 18.

Quick start

import { parseRc, parseNin, parseRib, isValidIban } from '@bakissation/houwiya';

// Extract just the part you need
parseRc('24B1282577').wilaya;       // { code: '16', name: 'Alger' } (when present)
parseRc('24B1282577').entityType;   // 'morale'   (A/أ → physique, B/ب → morale)
parseNin('119881234056700007').sex; // 'female'   (+ birthYearDigits, communeCode…) — Luhn-checked
parseRib('00100023456...').account; // decomposed; mod-97 verified
isValidIban('DZ58 0002 1000 ...');  // ISO mod-97

Lenient by design: even when valid is false, any parts that could be extracted are still returned.

Supported identifiers

| Identifier | Function | Checksum | Extracts | |---|---|---|---| | NIN (national ID) | parseNin | Luhn | sex, birth year, commune, act sequence | | NIF (tax) | parseNif | — | 15-digit core, establishment suffix | | NIS (statistical) | parseNis | — | wilaya, commune, secondary suffix | | RC (trade register) | parseRc | — | entity type (A/B/أ/ب), year, sequence, wilaya | | RIB (bank) | parseRib | mod-97 | bank, agency, account, key | | CCP / RIP (postal) | parseCcp | mod-97 | account, key, bridged RIB | | IBAN (DZ) | parseIban | ISO mod-97 | country, check, underlying RIB | | CNAS (employer) | parseCnasEmployer | — | wilaya, sequence |

Plus WILAYAS / lookupWilaya (the 69 provinces) and the mod97 / luhnValid / luhnCheckDigit / computeRibKey helpers.

Documentation

Full docs in docs/: getting started · API reference · identifiers reference (formats, checksums, legal basis) · architecture.

A note on accuracy

Where the law fixes a format (e.g. NIS = 15 digits, décret 97-396) the library enforces it. Where it doesn't (e.g. the RC digit layout, which is CNRC convention) the library parses leniently and never invents a checksum. See docs/identifiers.md for the per-identifier legal basis and caveats. These values are PII — don't log them in clear.

Contributing

Issues and PRs welcome — see CONTRIBUTING.md and the Code of Conduct. Releases are automated from Conventional Commits; don't bump the version or edit the changelog by hand.

Credits

Built and maintained by Abdelbaki Berkatiberkati.xyz · @bakissation.

License

MIT