monitor-sockets

Monitor & debug socket connections in Node.js seamlessly.

MIT License

Downloads
28
Stars
5

monitor-sockets

Monitor socket connections in Node.js

Installation

yarn add monitor-sockets

Use

// In your application index.js file before starting the server
const monitor = require("monitor-sockets");

monitor.start({ interval: 2000 });

// Renders the table on the terminal
┌────────────────┬─────────┬────────┬──────────┬─────────┬───────────┬───────┐
Socket NameCreatedIn UseRequestsTimeoutDestroyedError├────────────────┼─────────┼────────┼──────────┼─────────┼───────────┼───────┤
│ localhost:80822018200002├────────────────┼─────────┼────────┼──────────┼─────────┼───────────┼───────┤
│ localhost:80852020500000├────────────────┼─────────┼────────┼──────────┼─────────┼───────────┼───────┤
│ localhost:808620000020└────────────────┴─────────┴────────┴──────────┴─────────┴───────────┴───────┘

API

start(options)

Starts monitoring the socket connections for both HTTP and HTTPS.

  • options {Object}

    • interval - Refresh interval to update the data on the Terminal

LICENSE

MIT