Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

express-status-monitor

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-status-monitor - npm Package Compare versions

Comparing version 1.2.3 to 1.2.5

src/public/stylesheets/default.css

8

.eslintrc.json

@@ -6,2 +6,6 @@ {

},
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 8
},
"extends": "eslint:recommended",

@@ -65,6 +69,2 @@ "rules": {

"func-names": "error",
"func-style": [
"error",
"expression"
],
"generator-star-spacing": "error",

@@ -71,0 +71,0 @@ "global-require": "error",

@@ -16,6 +16,6 @@ {

"dependencies": {
"express": "^4.14.0",
"express-favicon-short-circuit": "^1.1.0",
"request": "^2.87.0",
"socket.io": "^2.1.0"
"express": "4.16.4",
"express-favicon-short-circuit": "1.1.1",
"request": "2.88.0",
"socket.io": "2.2.0"
},

@@ -30,2 +30,2 @@ "scripts": {

}
}
}
{
"name": "express-status-monitor",
"version": "1.2.3",
"version": "1.2.5",
"description": "Realtime Monitoring for Express-based Node applications",

@@ -14,3 +14,3 @@ "main": "index.js",

"engines": {
"node": ">=4"
"node": ">=8"
},

@@ -48,2 +48,7 @@ "author": "Rafal Wilinski <raf.wilinski@gmail.com> (http://rwilinski.me)",

"url": "https://github.com/capaj/"
},
{
"name": "Max Findel",
"email": "max@terminal.co",
"url": "https://github.com/maxfindel/"
}

@@ -57,16 +62,14 @@ ],

"dependencies": {
"debug": "^2.6.8",
"handlebars": "~4.0.12",
"on-headers": "^1.0.1",
"pidusage": "^1.1.6",
"request-promise-native": "^1.0.5",
"socket.io": "^2.0.3"
"axios": "0.18.0",
"debug": "4.1.1",
"handlebars": "4.1.2",
"on-headers": "1.0.2",
"pidusage": "2.0.17",
"request": "2.88.0",
"socket.io": "2.2.0"
},
"scripts": {
"coverage": "istanbul cover _mocha test -- --recursive",
"test-ci": "mocha --recursive",
"test": "mocha --recursive --watch",
"snyk-protect": "snyk protect",
"publish": "publish",
"prepublish": "npm run snyk-protect",
"example": "npm i && npm i --prefix examples && npm start --prefix examples",

@@ -76,12 +79,9 @@ "eslint": "eslint ."

"devDependencies": {
"bithound": "^1.7.0",
"chai": "^4.1.0",
"eslint": "^4.3.0",
"istanbul": "^0.4.5",
"mocha": "^3.4.2",
"publish": "^0.6.0",
"sinon": "^2.4.1",
"snyk": "^1.37.0"
"chai": "4.2.0",
"eslint": "5.16.0",
"mocha": "6.1.3",
"sinon": "7.3.1",
"snyk": "1.151.0"
},
"snyk": true
}

@@ -45,3 +45,5 @@ # express-status-monitor

title: 'Express Status', // Default title
theme: 'default.css', // Default styles
path: '/status',
socketPath: '/socket.io', // In case you use a custom path
websocket: existingSocketIoInstance,

@@ -48,0 +50,0 @@ spans: [{

module.exports = {
title: 'Express Status',
theme: 'default.css',
path: '/status',
socketPath: '/socket.io',
spans: [

@@ -5,0 +7,0 @@ {

@@ -17,3 +17,3 @@ const pidusage = require('pidusage');

pidusage.stat(process.pid, (err, stat) => {
pidusage(process.pid, (err, stat) => {
if (err) {

@@ -20,0 +20,0 @@ debug(err);

'use strict';
const request = require('request-promise-native');
const axios = require('axios');
module.exports = async (healthChecks) => {
healthChecks = healthChecks || [];
function allSettled (promises) {
const wrappedPromises = promises.map(p => Promise.resolve(p)
.then(
val => ({ state: 'fulfilled', value: val }),
err => ({ state: 'rejected', reason: err })
)
);
return Promise.all(wrappedPromises);
}
module.exports = async healthChecks => {
const checkPromises = [];
healthChecks.forEach(healthCheck => {
(healthChecks || []).forEach(healthCheck => {
let uri = `${healthCheck.protocol}://${healthCheck.host}`;
if (healthCheck.port) {

@@ -19,4 +29,4 @@ uri += `:${healthCheck.port}`;

checkPromises.push(request({
uri: uri,
checkPromises.push(axios({
url: uri,
method: 'GET'

@@ -26,5 +36,5 @@ }));

let checkResults = [];
const checkResults = [];
return _allSettled(checkPromises).then((results) => {
return allSettled(checkPromises).then(results => {
results.forEach((result, index) => {

@@ -47,9 +57,1 @@ if (result.state === 'rejected') {

};
function _allSettled(promises) {
let wrappedPromises = promises.map(p => Promise.resolve(p)
.then(
val => ({ state: 'fulfilled', value: val }),
err => ({ state: 'rejected', reason: err })));
return Promise.all(wrappedPromises);
}

@@ -19,4 +19,8 @@ const defaultConfig = require('./default-config');

typeof config.title === 'string' ? config.title : defaultConfig.title;
config.theme =
typeof config.theme === 'string' ? config.theme : defaultConfig.theme;
config.path =
typeof config.path === 'string' ? config.path : defaultConfig.path;
config.socketPath =
typeof config.socketPath === 'string' ? config.socketPath : defaultConfig.socketPath;
config.spans =

@@ -40,3 +44,3 @@ typeof config.spans === 'object' ? config.spans : defaultConfig.spans;

: defaultConfig.ignoreStartsWith;
config.healthChecks =

@@ -43,0 +47,0 @@ Array.isArray(config.healthChecks)

@@ -12,3 +12,2 @@ const fs = require('fs');

const validatedConfig = validate(config);
const bodyClasses = Object.keys(validatedConfig.chartVisibility)

@@ -22,9 +21,10 @@ .reduce((accumulator, key) => {

.join(' ');
const data = {
title: validatedConfig.title,
port: validatedConfig.port,
bodyClasses: bodyClasses,
socketPath: validatedConfig.socketPath,
bodyClasses,
script: fs.readFileSync(path.join(__dirname, '/public/javascripts/app.js')),
style: fs.readFileSync(path.join(__dirname, '/public/stylesheets/style.css'))
style: fs.readFileSync(path.join(__dirname, '/public/stylesheets/', validatedConfig.theme))
};

@@ -44,6 +44,4 @@

if (req.path === validatedConfig.path) {
healthChecker(validatedConfig.healthChecks).then((results) => {
healthChecker(validatedConfig.healthChecks).then(results => {
data.healthCheckResults = results;
if (validatedConfig.iframe) {

@@ -53,2 +51,3 @@ if (res.removeHeader) {

}
if (res.remove) {

@@ -58,2 +57,3 @@ res.remove('X-Frame-Options');

}
res.send(render(data));

@@ -84,3 +84,3 @@ });

middleware.pageRoute = (req, res) => {
healthChecker(validatedConfig.healthChecks).then((results) => {
healthChecker(validatedConfig.healthChecks).then(results => {
data.healthCheckResults = results;

@@ -87,0 +87,0 @@ res.send(render(data));

@@ -5,3 +5,3 @@ /*

*/
/* global Chart, location, document, port, parseInt, io */
/* global Chart, location, document, port, socketPath, parseInt, io */

@@ -17,3 +17,3 @@ 'use strict';

var socket = io(location.protocol + '//' + location.hostname + ':' + (port || location.port));
var socket = io(location.protocol + '//' + location.hostname + ':' + (port || location.port), { path: socketPath });
var defaultSpan = 0;

@@ -20,0 +20,0 @@ var spans = [];

@@ -66,5 +66,2 @@ const chai = require('chai');

});
});

@@ -71,0 +68,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc