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

krsyer-server-monitor-pro

v1.0.34

Published

API to get server details like IP address, health, applications running, etc.

Readme

Server Monitor Pro (SaaS)

A secure, SaaS-based server monitoring tool with Cashfree payment integration and obfuscated code for production.

Features

  • 🌐 SaaS Ready: Remote subscription verification.
  • 💳 Cashfree Integration: Professional payment gateway for subscriptions.
  • 🔒 Code Obfuscation: Securely packaged for NPM distribution.
  • 📊 Comprehensive Monitoring: CPU, Memory, PM2, Docker, and more.
  • ⌨️ Integrated Terminal: Direct access from your browser.

Installation

As a global CLI tool

npm install -g server-monitor-api

As a project dependency

npm install server-monitor-api

Setup

  1. Create a .env file in your project root:
PORT=3014
LICENSE_KEY=DEMO-123  # Get your key after payment
CASHFREE_APP_ID=your_app_id
CASHFREE_SECRET_KEY=your_secret_key
APP_URL=http://localhost:3014

Usage

Using CLI

server-monitor start --port 3014

In your Node.js app

const app = require('server-monitor-api');
// The app is an express instance
app.listen(3014);

API Endpoints

1. Get Comprehensive Server Information

Endpoint: GET /api/server/info

Returns complete server details including:

  • Public and local IP addresses
  • System information (hostname, OS, architecture)
  • CPU information (cores, speed, load average)
  • Memory usage statistics
  • Node.js version and process info
  • List of running PM2 applications

Response Example:

{
  "status": "success",
  "timestamp": "2025-12-27T13:44:35.000Z",
  "server": {
    "hostname": "server-name",
    "platform": "win32",
    "architecture": "x64",
    "type": "Windows_NT",
    "release": "10.0.22631",
    "uptime": {
      "raw": 86400,
      "formatted": "1d 0h 0m 0s"
    }
  },
  "network": {
    "publicIP": "203.0.113.1",
    "localIPs": [
      {
        "interface": "Ethernet",
        "address": "192.168.1.100",
        "netmask": "255.255.255.0",
        "mac": "00:00:00:00:00:00"
      }
    ]
  },
  "cpu": {
    "model": "Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz",
    "cores": 8,
    "speed": "3600 MHz",
    "loadAverage": {
      "1min": "0.50",
      "5min": "0.45",
      "15min": "0.42"
    }
  },
  "memory": {
    "total": "16.00 GB",
    "free": "8.50 GB",
    "used": "7.50 GB",
    "usagePercentage": "46.88%"
  },
  "node": {
    "version": "v18.17.0",
    "processUptime": {
      "raw": 3600,
      "formatted": "1h 0m"
    },
    "pid": 12345
  },
  "applications": [
    {
      "name": "my-app",
      "pid": 54321,
      "status": "online",
      "uptime": 1703689475000,
      "restarts": 2,
      "memory": "150.25 MB",
      "cpu": "2.5%",
      "mode": "cluster",
      "instances": 4
    }
  ]
}

2. Get Server Health Status

Endpoint: GET /api/server/health

Returns current health status with warnings based on resource usage.

Response Example:

{
  "status": "healthy",
  "timestamp": "2025-12-27T13:44:35.000Z",
  "uptime": "1d 0h 0m 0s",
  "checks": {
    "memory": {
      "status": "ok",
      "usage": "46.88%"
    },
    "cpu": {
      "status": "ok",
      "loadAverage": "0.50",
      "cores": 8
    }
  },
  "warnings": null
}

Health Status Values:

  • healthy - All systems normal
  • warning - Some metrics are elevated
  • critical - Action required (memory > 90% or CPU overloaded)

3. Get Running Applications

Endpoint: GET /api/server/applications

Returns list of applications managed by PM2.

Response Example:

{
  "status": "success",
  "timestamp": "2025-12-27T13:44:35.000Z",
  "count": 2,
  "applications": [
    {
      "name": "my-app",
      "pid": 54321,
      "status": "online",
      "uptime": 1703689475000,
      "restarts": 2,
      "memory": "150.25 MB",
      "cpu": "2.5%",
      "mode": "cluster",
      "instances": 4
    },
    {
      "name": "worker-app",
      "pid": 54322,
      "status": "online",
      "uptime": 1703689475000,
      "restarts": 0,
      "memory": "85.50 MB",
      "cpu": "1.2%",
      "mode": "fork",
      "instances": 1
    }
  ]
}

Usage Examples

Using cURL

# Get full server information
curl http://localhost:3014/api/server/info

# Check health status
curl http://localhost:3014/api/server/health

# List running applications
curl http://localhost:3014/api/server/applications

Using JavaScript/Fetch

// Get server information
const response = await fetch('http://localhost:3014/api/server/info');
const data = await response.json();
console.log('Server IP:', data.network.publicIP);
console.log('Memory Usage:', data.memory.usagePercentage);

Project Structure

getIPApi/
├── controllers/
│   └── serverController.js     # Controller logic for all endpoints
├── routes/
│   └── serverRoutes.js         # Route definitions
├── .env                         # Environment variables
├── .gitignore                   # Git ignore file
├── package.json                 # Project dependencies
├── README.md                    # This file
└── server.js                    # Main application entry point

Dependencies

  • express - Web framework
  • cors - Enable CORS
  • dotenv - Environment variables
  • axios - HTTP client for external API calls
  • pm2 - Process manager (optional, for listing applications)

Notes

  • The API uses https://api.ipify.org to fetch the public IP address
  • PM2 must be installed and running for the applications endpoint to return data
  • On Windows, some Unix-specific features (like load average) may not be available
  • The health endpoint uses the following thresholds:
    • Memory: Warning at 75%, Critical at 90%
    • CPU: Warning when load average > (cores × 2)

License

ISC