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

apiupbot

v1.0.6

Published

Smart uptime monitoring with Cap'n Proto compression and dark mode status dashboard

Readme

🤖 APIUpBot

npm version License: MIT Node.js Version

Smart uptime monitoring with Cap'n Proto compression and beautiful dark mode status dashboard


⚠️ Project Status - Beta Version

Hello! I'm the maintainer of this project. This is currently a beta version that will be integrated as a module into APIBooks in the future.

I chose Cap'n Proto for its exceptional data efficiency and speed. Here's why it makes a significant difference:

📊 Data Format Performance Comparison

| Format | Type | Avg. Size (1,000 entries) | Read Speed | Write Speed | CPU Usage | Schema / Type Safety | Notes | | :-------------- | :--------------- | :-----------------------: | :--------: | :---------: | :---------: | :------------------: | :--------------------------------------------------- | | JSON | Text (UTF-8) | ≈ 2.8 MB | ⏱️ ~32 ms | ⏱️ ~28 ms | 🧠 High | ❌ No | Simple and universal, but verbose and heavy for logs | | BSON | Binary (MongoDB) | ≈ 1.6 MB | ⏱️ ~20 ms | ⏱️ ~17 ms | 🧠 Medium | ✅ Partial | More compact than JSON, used by MongoDB | | MessagePack | Binary | ≈ 0.9 MB | ⚡ ~9 ms | ⚡ ~7 ms | 🔋 Low | ✅ Partial | Compact and portable, good middle ground | | Cap'n Proto | Binary Zero-Copy | ≈ 0.05 MB | ⚡🚀 ~1.2 ms | ⚡🚀 ~0.9 ms | 🔋 Very Low | ✅ Strong (schema) | Used by APIUpBot - Ultra-efficient uptime logs |

🚀 Result: Cap'n Proto is 56x smaller and 26x faster than JSON for logging operations!


APIUpBot is a lightweight, high-performance uptime monitoring solution that uses Cap'n Proto binary format for efficient data storage and provides a sleek dark-themed status page for visualizing your service health.

✨ Features

  • 🚀 High Performance: Built on Express.js with efficient binary storage using Cap'n Proto
  • 📊 Real-time Monitoring: Minute-by-minute health checks with configurable intervals
  • 🎨 Beautiful Status Page: Modern dark-themed dashboard with 30-day history visualization
  • 💾 Efficient Storage: Binary compression for minimal disk usage
  • 📈 Detailed Statistics: Response times, uptime percentages, and historical trends
  • 🔄 RESTful API: Easy integration with your existing systems
  • 🌐 Multiple Service Tracking: Monitor multiple endpoints simultaneously
  • Automatic Route Discovery: Built-in Express endpoint scanner

📦 Installation

npm install apiupbot

Or install globally:

npm install -g apiupbot

🚀 Quick Start

Important: Single Instance Mode

APIUpBot est conçu pour fonctionner en instance unique. Lorsque vous lancez APIUpBot, il démarre automatiquement sur le port configuré (par défaut 3000) et reste actif. Ne lancez pas plusieurs copies simultanément - utilisez toujours la même instance en cours d'exécution.

Use as a Standalone Server

La façon la plus simple d'utiliser APIUpBot est de le lancer directement en mode standalone. Une seule instance sera créée et restera active:

# Lancer l'instance unique
npm start

# OU en mode développement avec auto-reload
npm run dev

# Visitez http://localhost:3000/status pour voir le dashboard

Note: Le serveur reste actif et surveille vos endpoints automatiquement. Il n'est pas nécessaire de créer plusieurs instances.

Integrate into Your Express App (Mode Bibliothèque)

Si vous intégrez APIUpBot dans votre propre application Express, importez simplement l'app sans le relancer:

const express = require("express");
const apiupbot = require("apiupbot");

const app = express();
const PORT = process.env.PORT || 3000;

// Vos routes applicatives
app.get("/api/users", (req, res) => {
  res.json({ users: [] });
});

// Montez APIUpBot sur un sous-chemin (recommandé)
app.use("/monitoring", apiupbot);

// OU fusionnez les routes directement
// app.use(apiupbot);

app.listen(PORT, () => {
  console.log(`✅ Application running on http://localhost:${PORT}`);
  console.log(`📊 APIUpBot dashboard: http://localhost:${PORT}/monitoring/status`);
});

Important: Dans ce mode, APIUpBot partage le même port que votre application. Une seule instance du serveur est nécessaire.

Run from Source

Clonez le dépôt et lancez une seule instance:

npm install
npm start

Ou pour le développement avec auto-reload:

npm run dev

Configuration du Port

Pour éviter les conflits de port, configurez le port via les variables d'environnement:

# Linux/Mac
PORT=4000 npm start

# Windows (PowerShell)
$env:PORT=4000; npm start

# Windows (CMD)
set PORT=4000 && npm start

APIUpBot détectera automatiquement si le port est déjà utilisé et vous avertira. Dans ce cas, changez simplement le port ou arrêtez l'autre instance.

🔧 Configuration

Configure using environment variables:

# Server port (default: 3000)
PORT=3000

# URL to monitor (default: http://localhost:3000/health)
MONITOR_URL=http://localhost:3000/health

# Check interval in milliseconds (default: 60000 = 1 minute)
CHECK_INTERVAL=60000

📡 API Endpoints

Health Check

GET /health

Returns the current health status of the service.

Response:

{
  "status": "ok",
  "timestamp": 1704067200000,
  "uptime": 3600.123,
  "message": "Service is healthy"
}

Get Current Statistics

GET /api/stats

Returns current monitoring statistics.

Response:

{
  "success": true,
  "data": {
    "today": {
      "checks": 1440,
      "failures": 0,
      "avgResponseTime": 45,
      "uptime": 100
    }
  }
}

Get All Services

GET /api/services

Returns status information for all monitored services.

Response:

{
  "success": true,
  "data": {
    "services": [
      {
        "name": "API Service",
        "status": "ok",
        "ping": "45ms",
        "uptime": "99.9%",
        "history": [...]
      }
    ]
  }
}

Status Page

GET /status

Returns a beautiful HTML dashboard showing all service statuses with 30-day history visualization.

🎨 Status Page Features

The status page includes:

  • Global Status Indicator: At-a-glance view of all systems
  • Service List: Individual status for each monitored service
  • Response Times: Real-time ping measurements
  • Uptime Percentage: Historical reliability metrics
  • 30-Day History: Visual representation with color-coded dots
    • 🟢 Green: Operational
    • 🟡 Yellow: Degraded performance
    • 🔴 Red: Outage
  • Dark Mode: Easy on the eyes, modern interface
  • Last Update Timestamp: Know when data was last refreshed

💾 Storage

APIUpBot uses Cap'n Proto binary format for efficient data storage:

  • Compact: Significantly smaller than JSON
  • Fast: Quick read/write operations
  • Structured: Type-safe schema-based storage
  • Persistent: Survives restarts and maintains history

🛠️ Development

Project Structure

apiupbot/
├── index.js              # Main server file
├── utils/
│   ├── storage.js        # Cap'n Proto storage implementation
│   ├── logger.js         # Logging and statistics utilities
│   └── scanner.js        # Express endpoint discovery
├── template.html         # Status page template
├── package.json
└── README.md

Run Tests

npm test

Scripts

  • npm start - Start the production server
  • npm run dev - Start development server with hot reload
  • npm test - Run API tests

📊 Example Use Cases

Monitor External APIs

const MONITOR_URL = "https://api.example.com/health";

Monitor Multiple Services

const services = [
  { name: "API Gateway", url: "https://api.example.com/health" },
  { name: "Database", url: "https://db.example.com/health" },
  { name: "Cache", url: "https://cache.example.com/health" }
];

Integration with CI/CD

Use the API endpoints to integrate uptime monitoring into your CI/CD pipeline:

curl http://localhost:3000/api/stats

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

📮 Support

If you have any questions or need help, please check the npm package page for support information.

🔮 Roadmap

  • [ ] WebSocket support for real-time updates
  • [ ] Email/SMS notifications on downtime
  • [ ] Custom alert thresholds
  • [ ] Multi-region monitoring
  • [ ] Grafana integration
  • [ ] Docker container support
  • [ ] Kubernetes health checks

Made with ❤️ for the developer community