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

@akuma225/promise-executor

v1.0.3

Published

Bibliothèque TypeScript pour l'exécution parallèle de promesses avec gestion de clés

Readme

@akuma225/promise-executor

Une bibliothèque TypeScript pour exécuter plusieurs promesses en parallèle avec des clés associées.

Installation

npm install @akuma225/promise-executor

Caractéristiques

  • Exécution parallèle de promesses
  • Association de clés aux promesses pour identifier facilement les résultats
  • Gestion automatique du nettoyage après exécution
  • API simple et intuitive
  • Écrit en TypeScript avec types complets

Utilisation

import { AkumaPromiseExecutor } from '@akuma225/promise-executor';

// Créer une instance
const executor = new AkumaPromiseExecutor();

// Ajouter des promesses avec des clés
executor.add('utilisateurs', api.getUsers());
executor.add('produits', api.getProducts());
executor.add('commandes', api.getOrders());

// Exécuter toutes les promesses en parallèle
const results = await executor.execute();

// Accéder aux résultats par clé
console.log(results.utilisateurs);  // Résultats de getUsers()
console.log(results.produits);      // Résultats de getProducts()
console.log(results.commandes);     // Résultats de getOrders()

API

AkumaPromiseExecutor

add(key: string, promise: Promise<any>): void

Ajoute une promesse à exécuter avec une clé associée.

  • key: La clé unique pour identifier le résultat de la promesse
  • promise: La promesse à exécuter

execute(): Promise<{ [key: string]: any }>

Exécute toutes les promesses en parallèle et retourne les résultats dans un objet avec les clés correspondantes.

hasPendingPromises(): boolean

Vérifie s'il y a des promesses en attente d'exécution.

clear(): void

Efface toutes les promesses en attente.

Exemple avancé

const executor = new AkumaPromiseExecutor();

// Ajouter plusieurs promesses
executor.add('données1', fetchData1());
executor.add('données2', fetchData2());

try {
    // Exécuter les promesses
    const results = await executor.execute();
    
    // Utiliser les résultats
    processResults(results.données1, results.données2);
} catch (error) {
    // Gérer les erreurs
    console.error('Une erreur est survenue:', error);
} finally {
    // Vérifier s'il reste des promesses
    if (executor.hasPendingPromises()) {
        executor.clear();
    }
}

Contribution

Les contributions sont les bienvenues ! N'hésitez pas à ouvrir une issue ou à soumettre une pull request.

Licence

MIT