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

@mostajs/nomenclature

v0.2.0

Published

Référentiel de nomenclatures hiérarchiques (codes officiels) : charger, rechercher, valider et résoudre des codes liés par parentCode. Multi-schéma. Seeds livrés : 'naa-dz' (activités, CNRC/ONS), 'cim-10' (diagnostics, OMS/ICD-10), 'ccam' (actes médicaux)

Readme

@mostajs/nomenclature

Référentiel de nomenclatures hiérarchiques — charger, rechercher, valider et résoudre des codes d'activité officiels.

Auteur : Dr Hamid MADANI [email protected] · Licence : AGPL-3.0-or-later

Module mince à responsabilité unique. Aucune logique métier : il modélise un arbre de codes (section → division → groupe → classe → activité) consultable et validable. Transverse — il sert la pépinière (O4 Hadhinat : « choisir le code exact de l'activité parmi la liste officielle ») comme le CRM, la facturation, le reporting ou les déclarations légales.

Schéma livré : naa-dzNomenclature Algérienne des Activités (alignée CITI Rev.4 / NACE ; réf. CNRC & ONS NAA-NAP). Extensible (naf-fr, nace-eu…) par simple dataset injecté.

Installation

npm install @mostajs/nomenclature

Usage

import { createNomenclature, createMemoryRepositories } from '@mostajs/nomenclature';

const nom = createNomenclature({ repositories: createMemoryRepositories() }); // seed 'naa-dz' livré

await nom.codes.search('informatique');     // → propositions (préfixe code OU plein texte FR/AR)
await nom.codes.validate('62011');          // → { ok:true, normalized:'62011', label:'…', level:5 }
await nom.codes.path('62011');              // → [J › 62 › 620 › 6201 › 62011] (fil d'Ariane)
await nom.codes.children('J');              // → divisions de la section J
await nom.codes.label('62011', { lang:'ar' }); // → 'تطوير البرمجيات حسب الطلب'
await nom.schemes.tree();                   // → sections (racines)

En production, injecter de vrais repositories @mostajs/orm et un dataset complet :

import { createNomenclature } from '@mostajs/nomenclature';
const nom = createNomenclature({ repositories: ormRepos, dataset: jeuOfficielComplet, i18n });

API

| Méthode | Retour | |---|---| | codes.search(q, { scheme?, limit?, level?, activeOnly? }) | [{ scheme, code, label, level, parentCode }] — préfixe de code ou plein texte (insensible casse+accents, FR/AR) | | codes.get(code, { scheme? }) | { scheme, code, label, labelAr, parent, level, active } | null | | codes.children(code, { scheme? }) | sous-codes directs | | codes.validate(code, { scheme? }) | { ok, normalized, label, level } | { ok:false, reason } | | codes.path(code, { scheme? }) | [{code,label,level}…] racine → feuille | | codes.label(code, { scheme?, lang }) | libellé résolu (fr|ar) | | schemes.list() / schemes.tree({ scheme? }) | schémas présents / racines (niveau 1) |

Composition (injection)

repositories (obligatoire) · dataset (défaut = seed naa-dz) · i18n (libellés FR/AR) · data-plug (import). Les codes sont normalisés (majuscules, sans espaces ni points : 62.016201).

Niveaux : 1 section (lettre A…U) · 2 division (2 ch.) · 3 groupe (3) · 4 classe (4) · 5 activité nationale (5).

Tests & exemple

npm test       # 7 tests unitaires
npm run example # sélecteur de code d'activité (O4)

Voir docs/00-PROPOSITION-PLAN-NOMENCLATURE-19062026.md (cas C, étape E1).