🚀 Launch Week Day 5:Introducing Immutable Scans.Learn More →
Socket
Book a DemoInstallSign in
Socket

log-parser

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

log-parser

Parse a log stream that contains JSON, error stacks or simple messages

Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

log-parser

Parse a log stream that contains JSON, error stacks or simple messages

npm install e-conomic/log-parser

Usage

var parser = require('log-parser')
var parse = parser()

parse.write(JSON.stringify({hello:'world'})+'\n')
parse.write('hello you\n')
parse.write(JSON.stringify([{hello:'world'}])+'\n')
parse.write(new Error('lol').stack+'\n')
parse.write('and another one\n')

parse
  .on('message', function(message) {
    console.log('message:', message)
  })
  .on('json', function(json) {
    console.log('json:', json)
  })
  .on('stack', function(stack) {
    console.log('stack:', stack)
  })

License

MIT

FAQs

Package last updated on 11 Sep 2014

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