Socket
Book a DemoInstallSign in
Socket

express-watcher

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-watcher

It is a middleware of monitoring Express router, this middleware can be used either globally or on a per-route basis and sends information of response time, used memory and CPU.

1.0.0
Source
npmnpm
Version published
Weekly downloads
7
-53.33%
Maintainers
1
Weekly downloads
 
Created
Source

express-watcher

It is a tool to solve the problem of resolving serise promise functions with parameter continuously. And there is not a solution but only resolving parallelly.

NPM

Install

$ npm install --save express-watcher

Usage


var resourceMonitorMiddleware = require('express-watcher').resourceMonitorMiddleware

// example without callback function
app.use(resourceMonitorMiddleware)

Using with Callback


var resourceMonitorMiddlewareCB = require('express-watcher').resourceMonitorMiddlewareCB

// example with callback function
app.use(function(req, res, next){
  resourceMonitorMiddlewareCB(req, res, next, function(diffJson){
    console.log(' diffJson : ', diffJson)
  })
})


// { 
//      diffRss: 0.0078125,
//      diffHeapTotal: 0,
//      diffHeapUsed: 0.012725830078125,
//      diffExternal: 0,
//      diffCpu: 0.000427 
// }

Functionality

1- Monitoring each response

Return object as a callback:

{ diffRss: 0.0078125,
  diffHeapTotal: 0,
  diffHeapUsed: 0.012725830078125,
  diffExternal: 0,
  diffCpu: 0.000427 }

And auto print: image

2- Monitoring all time high information

All time high information is printed when closing (CRT+c) the node process

And auto print: image

Reference

License

MIT

Keywords

express

FAQs

Package last updated on 27 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.