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/fournisseurs

v0.2.0

Published

Référentiel des TIERS QUI NOUS VENDENT : identité, références croisées code ↔ matière, rapprochement d'un nom lu sur une facture.

Readme

@mostajs/fournisseurs

Auteur : Dr Hamid MADANI [email protected] Licence : AGPL-3.0-or-later · Version : 0.1.0 · Dépendances : aucune

Le référentiel des tiers qui nous vendent : identité, références croisées « code ↔ matière », rapprochement d'un nom lu sur une facture avec un fournisseur connu.


Le problème qu'il résout

Trois modules touchent au fournisseur ; aucun ne le possédait :

| module | ce qu'il en fait | |---|---| | @mostajs/piece-extract | produit une identité en lisant une facture — et ne la range nulle part | | @mostajs/sourcing | consomme une liste de « fournisseurs connus » — sans la constituer | | @mostajs/stocks | garde une chaîne libre sur chaque matière — pas une entité |

D'où « METRO », « METRO FRANCE » et « Metro France » comme trois fournisseurs distincts, et aucun rapprochement possible. Ce module tient l'entité, une fois, pour tous.

Installation

pnpm add @mostajs/fournisseurs

Usage

import { creerFournisseurs } from '@mostajs/fournisseurs';
import { register } from '@mostajs/fournisseurs/register';   // au montage — sans lui, aucune table

const fournisseurs = creerFournisseurs({
  depot: magasin.repo('fournisseurs'),
  depotReferences: magasin.repo('references_fournisseur'),
});

const metro = await fournisseurs.creer({ nom: 'METRO FRANCE', siret: '…', delaiPaiementJours: 30 });
await fournisseurs.referencer({ fournisseurId: metro.id, code: '4711', matiereId: riz.id, parColis: 12 });

const connu = await fournisseurs.trouverParNom(piece.emetteur.nom);   // PROPOSE, ne crée jamais

Les quatre règles à connaître

  1. trouverParNom propose, ne crée JAMAIS. La machine rapproche, l'humain rattache.
  2. Le SIRET est facultatif (un fournisseur étranger n'en a pas) mais vérifié par la clé de Luhn s'il est fourni. Mieux vaut vide que faux.
  3. Un code est unique par fournisseur, jamais globalement : « 4711 » est du riz chez l'un, du saumon chez l'autre.
  4. matiereId est opaque. Le module ne connaît pas @mostajs/stocks — c'est ce qui le rend utilisable par une association qui n'a aucun stock.

La fiche complète, avec tous les pièges : llms.txt.

Ce qu'il ne fera pas

Les commandes d'achat et la comptabilisation (@mostajs/compta), la recherche d'offres et la comparaison de prix (@mostajs/sourcing), les mouvements de stock (@mostajs/stocks).

⚠️ Le mot « fournisseur » désigne ici un tiers commercial. Dans @mostajs/payment, aop-providers et chat, il désigne un prestataire technique (banque, modèle de langage) : rien de commun.

Essais

pnpm test        # 31 essais — @mostajs/mjs-unit, preuve HTML dans test-scripts/.out/

Six groupes, un par exigence de docs/DEVTEST-PLAN.fournisseurs.json (format mostajs-devtest/1).