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/auth-dialects

v0.1.0

Published

Registre ZÉRO-DÉPENDANCE des « variétés » de connexion (DIALECTES) pour l'auth : magic-link (mail / sms = magic-sms-link / mail&sms) + biométrie WebAuthn (face / finger / iris). DB-agnostique (port userRepo), extensible (register).

Readme

@mostajs/auth-dialects

Auteur : Dr Hamid MADANI [email protected] · Licence : AGPL-3.0-or-later Membre du @mostajs/auth-stack (avec mosta-auth, mosta-auth-lite, mosta-auth-flow, mosta-sms-lite, mosta-smtp-lite, mosta-broadcast).

Registre zéro-dépendance des « variétés » de connexion — les dialectes — pour l'authentification, dans l'esprit de @mostajs/orm (DB-agnostique, ports injectés). Une variété de login = un dialecte.

Façon dialectes — même paradigme que les drivers de @mostajs/sms-lite, les canaux de @mostajs/broadcast et les schémas de @mostajs/nomenclature : un registre extensible où l'on enregistre des variantes sans toucher au flux.

Deux familles (kind)

| Famille | Principe | Variétés | |---|---|---| | magic-link | sans mot de passe — le lien magique est livré par un/des canal(aux) | mail, sms (magic-sms-link), mail&sms | | biometric | vérification sur l'appareil via WebAuthn/passkeys (déléguée à @mostajs/auth) | face, finger, iris |

Catalogue par défaut (les 6)

| key | kind | status | canaux / mécanisme | |---|---|---|---| | mail | magic-link | active | emailmatch=email, resolve=findByEmail | | sms | magic-link | active | sms (magic-sms-link) — match=numéro, resolve=findByPhone | | mail&sms | magic-link | active | email+sms — comportement par défaut (compte avec email et numéro) | | face | biometric | planned | face-api.js (client) + PWA scan (caméra) — provider=face-api, capture=pwa-scan | | finger | biometric | planned | WebAuthn platform, uv=required (provider=webauthn) | | iris | biometric | planned | WebAuthn platform, uv=required (provider=webauthn) |

facefinger/iris : la reconnaissance faciale passe par face-api.js (ML côté navigateur) avec capture caméra en PWA (pwa-scan) — pas de WebAuthn. finger/iris utilisent l'authentificateur de plateforme WebAuthn.

Réalité WebAuthn (finger/iris) : on ne peut pas exiger « iris » plutôt qu'« empreinte » — l'OS choisit la modalité (userVerification: required) ; les deux noms sont du branding/UX sur un seul mécanisme.

Usage

import { createDialectRegistry } from '@mostajs/auth-dialects';

const reg = createDialectRegistry();

// 1) sélection par identifiant (email ou numéro)
const dialect = reg.select(identifier);     // '[email protected]' → mail ; '+213…' → sms
if (dialect?.resolve) {
  const user = await dialect.resolve(identifier, userRepo);   // port { findByEmail, findByPhone }
  if (user) { /* émettre le magic-link pour user.email, livrer selon dialect.channels */ }
}

// 2) introspection (UI / matrice / doc)
reg.byKind('biometric');   // [face, finger, iris]
reg.active();              // [mail, sms, mail&sms]

// 3) extension — ajouter une variété sans toucher au flux
reg.register({
  key: 'whatsapp', label: 'WhatsApp', kind: 'magic-link', status: 'active',
  match: (id) => String(id).startsWith('wa:'),
  resolve: (id, repo) => repo.findByPhone(id),
});

API

  • createDialectRegistry({ dialects? }){ list, get, byKind, active, planned, select, register }
  • defaultDialects() → les 6 dialectes
  • normalizePhone(s) · looksLikePhone(id) · KINDS · STATUS

register(d) fait un upsert par key et place le dialecte en tête (priorité de select). DB-agnostique : resolve dépend du port userRepo fourni par le consumer.

Référence d'implémentation

Hadhinat incubator/app/auth.mjs consomme ce registre ; le transport SMS est @mostajs/sms-lite (méthode magic-sms-link) ; la biométrie sera câblée via WebAuthn de @mostajs/auth. Voir llms.txt.