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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@ix-xs/metamob.api

v2.0.1

Published

🚀 SDK JavaScript officieux pour l'API Metamob - Dofus 🐉

Readme

🔥 @ix-xs/metamob.api

Node.js JavaScript NPM GitHub

🚀 SDK JavaScript officieux pour l'API Metamob - Dofus 🐉

Une librairie performante pour interagir avec l'écosystème Dofus via Metamob

npm version Downloads License


🌟 Aperçu

@ix-xs/metamob.api est un SDK JavaScript moderne et puissant conçu spécialement pour l'API Metamob, permettant aux développeurs de créer facilement des applications Dofus avec une intégration fluide et performante.

✨ Fonctionnalités principales

  • 🔥 Cache intelligent avec synchronisation automatique disque/mémoire
  • Performances optimales grâce à un système de cache avancé
  • 🛡️ Sécurité renforcée avec écriture atomique des fichiers
  • 🎯 API moderne avec support complet TypeScript (jsdoc)
  • 📖 Documentation complète avec exemples pratiques
  • 🔄 Rate limiting automatique avec retry intelligent
  • 🌐 Support complet de toutes les endpoints Metamob

🚀 Installation rapide

# NPM
npm install @ix-xs/metamob.api

# Yarn
yarn add @ix-xs/metamob.api

# PNPM
pnpm add @ix-xs/metamob.api

📋 Prérequis

  • Node.js >= 18.0.0
  • NPM >= 8.0.0
  • Une clé API Metamob valide

💡 Utilisation de base

const metamobAPI = require("@ix-xs/metamob.api");
const client = new metamobAPI("VOTRE_CLÉ_API_METAMOB");

// Utilisation du cache (recommandé)
console.log(client.cache.servers);   // Serveurs en cache
console.log(client.cache.monsters);  // Monstres en cache
console.log(client.cache.areas);     // Zones en cache

// Ou récupération via API
const servers = await client.getServers();
const user = await client.getUser("Ix-xs");
const monsters = await client.getUserMonsters("Ix-xs");

🏗️ Architecture du cache

🧠 Cache intelligent multicouche

Notre système de cache combine :

  • 📁 Cache disque : Persistance des données via JSON
  • 💾 Cache mémoire : Accès ultra-rapide via require()
  • 🔄 Synchronisation automatique : Mise à jour seamless
  • 🛡️ Écriture atomique : Prévention de la corruption des données
// Le cache est automatiquement synchronisé
await client.getServers(); // Met à jour le cache si nécessaire

// Accès instantané depuis le cache mémoire
const servers = client.cache.servers;

📊 Types de cache disponibles

| Type | Description | Endpoint | |------|-------------|----------| | servers | Serveurs Dofus | /serveurs | | monsters | Base de données des monstres | /monstres | | areas | Zones de jeu | /zones | | subareas | Sous-zones détaillées | /sous-zones |


🔧 API complète

👤 Gestion des utilisateurs

// Informations utilisateur
const user = await client.getUser("pseudo");

// Monstres d'un utilisateur
const userMonsters = await client.getUserMonsters("pseudo");

// Mise à jour des monstres
await client.setUserMonsters("pseudo", "unique_id", [
    { monstre: "Arakne", etat: "recherche", quantite: 5 },
    { monstre: "Boufton Blanc", etat: "propose", quantite: 2 }
]);

// Réinitialisation des monstres
await client.resetUserMonsters("pseudo", "unique_id");

🎮 Données de jeu

// Cache instantané (recommandé)
const servers = client.cache.servers;
const monsters = client.cache.monsters;
const areas = client.cache.areas;
const subareas = client.cache.subareas;

// Ou via API avec mise à jour du cache
const freshServers = await client.getServers();
const freshMonsters = await client.getMonsters();
const freshAreas = await client.getAreas();
const freshSubareas = await client.getSubareas();

🐙 Kralamoures

// Toutes les ouvertures kralamoures
const kralamoures = await client.getKralamoures();

// Avec filtres
const filtered = await client.getKralamoures({
    server: "Salar",
    start_date: "2025-01-01",
    end_date: "2025-12-31"
});

📊 Structure de réponse

Toutes les méthodes retournent un objet standardisé :

{
    ok: boolean,           // Succès de la requête
    status: number,        // Code de statut HTTP
    statusText: string,    // Message de statut
    retryAfter?: number,   // Délai avant retry (si 429)
    errors?: string[],     // Erreurs éventuelles
    data?: any            // Données de réponse
}

⚡ Optimisations avancées

🚀 Cache Strategy

// Préférez toujours le cache pour les données statiques
const servers = client.cache.servers;  // ✅ Instantané
const servers = await client.getServers(); // ❌ Plus lent

// Le cache se met à jour automatiquement si nécessaire

🔄 Rate Limiting

Le SDK gère automatiquement :

  • Détection du rate limiting (429)
  • Retry automatique avec backoff
  • Headers de retry respectés

🛠️ Configuration avancée

📁 Structure des fichiers cache

.cache/
├── $.js          # Index des caches
├── servers.json  # Serveurs
├── monsters.json # Monstres
├── areas.json    # Zones
└── subareas.json # Sous-zones

🔧 Personnalisation

Le cache utilise :

  • write-file-atomic pour l'écriture sécurisée
  • Formatage JSON avec indentation (4 espaces)
  • Rechargement automatique du cache Node.js

🏆 Contributeurs & Support

👨‍💻 Créateur

Ix-xs
Développeur auto-didacte & Passionné Dofus

Discord GitHub


💬 Besoin d'aide ?


🌟 Si ce projet vous aide, n'hésitez pas à lui donner une étoile !

Star on GitHub

Développé avec ❤️ pour la communauté Dofus


⚡ Propulsé par l'API Metamob | Optimisé pour la performance | Conçu pour les développeurs