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

elephas

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

elephas - npm Package Compare versions

Comparing version 0.1.11 to 0.1.12

15

lib/express-logger.js

@@ -5,2 +5,3 @@ var winston = require('winston');

var statsd = require('./statsd');
var cluster = require('cluster');

@@ -57,2 +58,13 @@ function _calcLogLevel(statusCode) {

// var pid = cluster.isWorker ? cluster.worker.process.pid : process.pid;
var user;
if (req && req.session && req.session.passport && req.session.passport.user) {
user = chalk.gray(req.session.passport.user);
}
else {
user = chalk.red('anonymous');
}
var msg = [

@@ -63,3 +75,4 @@ chalk.gray(req.method),

req.originalUrl,
chalk.gray(req && req.session && req.session.passport ? req.session.passport.user : '')
user,
// chalk.gray('pid=' + pid)
].join(' ');

@@ -66,0 +79,0 @@

3

lib/framework.js

@@ -28,3 +28,4 @@ 'use strict';

server: {
port: 3000
port: 3000,
cluster: false
},

@@ -31,0 +32,0 @@ logger: null

'use strict';
var http = require('http'),
logger = require('./logger');
var http = require('http');
var cluster = require('cluster');
var numCPUs = require('os').cpus().length;
var logger = require('./logger');
var startServer = function(done, app, options) {
var h = http.createServer(app);
h.listen(options.port);
if (options.cluster) {
if (cluster.isMaster) {
// Fork workers.
for (var i = 0; i < numCPUs; i++) {
cluster.fork();
}
logger.success('Started at http://localhost:' + options.port);
cluster.on('exit', function(worker, code, signal) {
logger.error('worker ' + worker.process.pid + ' died');
});
}
else {
// Workers can share any TCP connection
// In this case its a HTTP server
http.createServer(app)
.listen(options.port);
logger.query('Started worker pid: ' + cluster.worker.process.pid);
}
}
else {
var h = http.createServer(app);
h.listen(options.port);
logger.success('Started at http://localhost:' + options.port + ' (single core)');
}
done();

@@ -13,0 +38,0 @@ };

{
"name": "elephas",
"version": "0.1.11",
"version": "0.1.12",
"description": "Some added sugar on top of express to give our our some sensible defaults and a little structure.",

@@ -5,0 +5,0 @@ "main": "elephas.js",

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