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

@frederictriquet/femtologger

v0.1.4

Published

Lightweight, extensible event logger for TypeScript server apps

Readme

FemtoLogger 🪶

CI/CD License: MIT TypeScript Node.js Coverage

Lightweight, extensible event logger for TypeScript server apps

FemtoLogger est un logger minimaliste conçu pour envoyer des événements applicatifs vers des services de messagerie (Telegram, Slack, Discord, etc.) avec une architecture modulaire et extensible.

Caractéristiques ✨

  • Léger : Zéro dépendance runtime, ~10KB minifié
  • Extensible : Architecture transport-based, facile d'ajouter de nouvelles destinations
  • Type-safe : 100% TypeScript avec types complets exportés
  • Multi-destinations : Support natif de plusieurs transports simultanés
  • Robuste : Gestion d'erreurs silencieuse — un logger ne fait jamais crasher votre app
  • Node 18+ : Utilise fetch natif (pas de polyfill)

Installation 📦

npm install @frederictriquet/femtologger

Utilisation rapide 🚀

Configuration basique avec Telegram

import { FemtoLogger, TelegramTransport } from '@frederictriquet/femtologger';

const logger = new FemtoLogger({
  transports: [
    new TelegramTransport({
      token: process.env.TELEGRAM_BOT_TOKEN!,
      chatId: process.env.TELEGRAM_CHAT_ID!,
    }),
  ],
});

// Utilisation
await logger.info('Server started', { port: 3000 });
await logger.warn('High memory usage', { usage: '85%' });
await logger.error('Database connection failed', { error: err.message });

Configuration multi-destinations

import { FemtoLogger, TelegramTransport } from '@frederictriquet/femtologger';

const logger = new FemtoLogger({
  transports: [
    new TelegramTransport({
      token: process.env.TELEGRAM_BOT_TOKEN!,
      chatId: process.env.TELEGRAM_CHAT_ID!,
    }),
    // Futures destinations (Slack, Discord, etc.)
  ],
  level: 'warn', // Log seulement warn et error
});

Obtenir vos credentials Telegram 🤖

  1. Créer un bot :

    • Envoyez /newbot à @BotFather sur Telegram
    • Suivez les instructions
    • Récupérez votre token (ex: 123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11)
  2. Obtenir votre Chat ID :

    • Envoyez un message à @userinfobot
    • Il vous répondra avec votre chatId (ex: 123456789)
  3. Variables d'environnement :

    # .env
    TELEGRAM_BOT_TOKEN=123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11
    TELEGRAM_CHAT_ID=123456789

API 📚

FemtoLogger

Constructor

new FemtoLogger(options: LoggerOptions)

| Option | Type | Défaut | Description | |--------|------|--------|-------------| | transports | Transport[] | required | Liste des destinations de logs | | level | 'info' \| 'warn' \| 'error' | 'info' | Niveau minimum de log |

Méthodes

logger.info(message: string, metadata?: Record<string, unknown>): Promise<void>
logger.warn(message: string, metadata?: Record<string, unknown>): Promise<void>
logger.error(message: string, metadata?: Record<string, unknown>): Promise<void>

TelegramTransport

Constructor

new TelegramTransport(options: TelegramTransportOptions)

| Option | Type | Défaut | Description | |--------|------|--------|-------------| | token | string | required | Token du bot Telegram | | chatId | string \| number | required | ID du chat de destination | | parseMode | 'HTML' \| 'Markdown' \| 'MarkdownV2' | 'HTML' | Mode de parsing des messages | | disableWebPagePreview | boolean | true | Désactiver les previews de liens |

Étendre avec de nouveaux transports 🔌

Créer un nouveau transport est trivial — une seule interface à implémenter :

import type { Transport, LogEntry } from '@frederictriquet/femtologger';

export class SlackTransport implements Transport {
  constructor(private webhookUrl: string) {}

  async send(entry: LogEntry): Promise<void> {
    try {
      await fetch(this.webhookUrl, {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({
          text: `${entry.level.toUpperCase()}: ${entry.message}`,
          // ... autres champs Slack
        }),
      });
    } catch (error) {
      console.error('[SlackTransport] Error:', error);
    }
  }
}

Architecture 🏗️

FemtoLogger (core)
├── Transport (interface)
│   ├── TelegramTransport
│   ├── [Future] SlackTransport
│   └── [Future] DiscordTransport
└── LogEntry (type)

Pattern : Strategy Pattern — chaque destination implémente l'interface Transport.

Roadmap 🗺️

  • [x] ~~Tests unitaires~~ — 64 tests, 97.67% couverture
  • [ ] Transport Slack
  • [ ] Transport Discord
  • [ ] Option de batching (regrouper plusieurs logs)
  • [ ] Rate limiting intégré

Contribution 🤝

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

License 📄

MIT © Fred


Philosophy "Femto" : Rester léger, simple, et efficace. Pas de features inutiles, juste ce qu'il faut pour bien faire le job.