Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
HTTP request logger middleware for node.js based on morgan
"use strict";
var logger = require( 'devlogger' );
var express = require( 'express' );
var app = express();
function response( req, res ) {
res.json( {result: "ok"} );
}
app.use( logger( 'dev' ) );
app.use( "/", response );
app.listen( 5000 );
result
-> 10:28:39.849 GET > 304 > / - Chrome 38.0.2125 > Other > Mac OS X 10.10.0 > 127.0.0.1
-> 10:36:55.310 GET > 200 > / - Mobile Safari 8.0 > iPhone > iOS 8.1 > 10.58.100.201
Or even
"use strict";
var logger = require( 'devlogger' );
var express = require( 'express' );
var app1 = express();
var app2 = express();
require( "colors" );
function response( req, res ) {
res.json( {result: "ok"} );
}
app1.use( logger( 'SERVER1 '.green + logger.dev ) );
app1.use( "/", response );
app1.listen( 5000 );
app2.use( logger( 'SERVER2 '.blue + logger.dev ) );
app2.use( "/", response );
app2.listen( 5001 );
result
SERVER1 -> 10:36:55.310 GET > 200 > / - Mobile Safari 8.0 > iPhone > iOS 8.1 > 10.58.100.201
SERVER2 -> 10:45:30.287 GET > 304 > / - Chrome 38.0.2125 > Other > Mac OS X 10.10.0 > 127.0.0.1
SERVER2 -> 10:45:30.319 GET > 304 > /favicon.ico - Chrome 38.0.2125 > Other > Mac OS X 10.10.0 > 127.0.0.1
SERVER1 -> 10:45:42.220 GET > 304 > / - Mobile Safari 8.0 > iPhone > iOS 8.1 > 10.58.100.201
SERVER2 -> 10:45:44.415 GET > 200 > / - Mobile Safari 8.0 > iPhone > iOS 8.1 > 10.58.100.201
The :date token takes a pattern parameter and formats the date using dateformat.
logger( '-> :date[HH:MM:ss.l] :method > :status ...' );
result
-> 10:28:39.849 GET > 304 ...
Devlogger also benefits of using ua-parser
logger( '-> :os > :device > :browser' )
result
-> Mobile Safari 8.0 > iPhone > iOS 8.1
-> Chrome 38.0.2125 > Other > Mac OS X 10.10.0
FAQs
HTTP request logger middleware for node.js
The npm package devlogger receives a total of 0 weekly downloads. As such, devlogger popularity was classified as not popular.
We found that devlogger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.