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

robin-logger

v0.2.1

Published

Cliente Node.js para enviar eventos de login, auditoría y actividad a Robin Logs

Readme

🪶 Robin Logger (Node.js)

Robin Logger es la versión Node.js de la librería Python robin-logger. Envía eventos de login, auditoría y actividad hacia un backend centralizado mediante HTTP.

Versión: 0.2.1

✨ Características

  • 🚀 Envío asíncrono (no bloquea tu aplicación)
  • 🔄 Retry automático con backoff exponencial
  • 💾 Cache local con límite de tamaño (30 MB por defecto)
  • 🔁 Reintentos automáticos en background para logs en cache
  • ⏱️ Backoff exponencial para reintentos periódicos
  • 🔧 Configurable mediante opciones o variables de entorno
  • 📊 TypeScript con tipos incluidos

📦 Instalación

npm install robin-logger

Requiere Node.js 18+ (usa fetch nativo).

🚀 Uso Rápido

Ejemplo básico

import { RobinLogger } from "robin-logger";

const logger = new RobinLogger({
  baseUrl: "https://api.robinlogs.com/v1/logs",
  apiKey: "tu_api_key_aqui",
});

logger.sendLog({
  type: "login",
  category: "user_auth",
  subcategory: "success",
  level: "info",
  data: {
    username: "william",
    ip: "192.168.1.10",
  },
});

TypeScript

import { RobinLogger } from "robin-logger";

const logger = new RobinLogger({
  baseUrl: process.env.ROBIN_LOGGER_URL!,
  apiKey: process.env.ROBIN_LOGGER_API_KEY!,
});

await logger.sendLogAsync({
  type: "audit",
  category: "data_access",
  subcategory: "read",
  level: "info",
  data: { user_id: 1234, resource: "users_table" },
});

Variables de entorno

ROBIN_LOGGER_URL=https://api.robinlogs.com/v1/logs
ROBIN_LOGGER_API_KEY=tu_api_key_aqui
import { RobinLogger } from "robin-logger";

const logger = new RobinLogger();
logger.sendLog({ type: "activity", category: "user_action", subcategory: "click", level: "info", data: {} });

Express

import express from "express";
import { RobinLogger } from "robin-logger";

const app = express();
const logger = new RobinLogger();

app.post("/login", (req, res) => {
  logger.sendLog({
    type: "login",
    category: "user_auth",
    subcategory: "success",
    level: "info",
    data: {
      username: req.body.username,
      ip: req.ip,
    },
  });
  res.json({ status: "ok" });
});

🔧 Configuración

new RobinLogger({
  baseUrl: string,              // o ROBIN_LOGGER_URL
  apiKey: string,               // o ROBIN_LOGGER_API_KEY
  timeout: 10,                  // segundos
  maxRetries: 3,
  backoffFactor: 0.5,           // 0.5s, 1s, 2s, 4s...
  enableLocalCache: true,
  cacheDir: undefined,          // default: ~/.robin_logger_cache
  cacheMaxSizeMb: 30.0,
  asyncMode: true,
  autoRetryEnabled: true,
  autoRetryInterval: 60,        // segundos
  autoRetryMaxInterval: 3600,
  autoRetryAsync: true,
});

📊 API

| Método | Descripción | |--------|-------------| | sendLog(options) | Envía un log (async por defecto) | | sendLogAsync(options) | Envía un log y retorna Promise | | retryCachedLogs() | Reintenta logs en cache manualmente | | getCacheStats() | Estadísticas del cache | | getRetryStats() | Estado de reintentos automáticos | | clearCache() | Limpia el cache local | | stopAutoRetry() | Detiene reintentos automáticos | | close() | Cierra el logger y detiene reintentos |

📝 Payload enviado

{
  "type": "login",
  "category": "user_auth",
  "subcategory": "success",
  "level": "info",
  "timestamp": "2025-10-31 12:00:00",
  "data": { "username": "william", "ip": "192.168.1.10" }
}

Headers:

Content-Type: application/json
Authorization: Bearer {api_key}
User-Agent: robin-logger-node/0.2.1

🔄 Paridad con Python

Esta versión Node.js replica la API y comportamiento de robin-logger Python >= 0.2.1:

  • Cache local con rotación FIFO al exceder el límite
  • Reintentos HTTP inmediatos (429, 500, 502, 503, 504)
  • Reintentos automáticos en background con backoff exponencial
  • Mismas variables de entorno

📄 Licencia

MIT — ver LICENSE.


Robin Logger Node.js v0.2.1 — Hecho con ❤️ por Diego