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

ncsa-combined-log-format

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

ncsa-combined-log-format

A transform stream, converting combined common log format to object

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

node-ncsa-combined-log-format

A transform stream, converting combined common log format to object

Usage

npm install common-log-format
var Clf = require("ncsa-combined-log-format");
var stream = require("stream");
var output = new stream.Writable({objectMode:true});
output._write = function(chunk, enc, cb) {
    console.log(chunk);
    cb();
};
var input = new stream.Readable();
var clf = new Clf();
clf.on("error",function(e){
	console.log(e);
});
input.pipe(new Clf()).pipe(output);
input.push("127.0.0.1 logname user [Wed, 11 Jun 2014 15:51:48 GMT] \"GET /package.json HTTP/1.1\" 200 733 \"http://localhost:8000/\" \"userAgent\"\n");
input.push(null);

Will output:

{ host: '127.0.0.1',
  logName: 'logname',
  user: 'user',
  date: 2014-06-11T15:51:48.000Z,
  request: { method: 'GET', httpVersion: '1.1', uri: '/package.json' },
  statusCode: 200,
  size: 733,
  referer: 'http://localhost:8000/',
  userAgent: 'userAgent' }

FAQs

Package last updated on 17 Mar 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

  • 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