Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm's 300,000 packages pre-installed, including ltsv-stream with all npm packages installed. Try it out:

var ltsvStream = require("ltsv-stream")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

ltsv-stream v0.0.2

transfer parser stream of LTSV

Build Status

introduction

transfer stream of LTSV parser

Usage

var ltsv2json = require('ltsv-stream').ltsv2json
  , fs = require('fs');

var ltsv = new ltsv2json({stringify: true});
fs.createReadStream('ltsv-access.log').pipe(ltsv).pipe(process.stdout);

you can also use parse() for parse LTSV format record into josn.

var ltsv = new ltsv2json();
var record = ['host:127.0.0.1', 'ident:-'].join('\t');
ltsv.parse(record); // { host: '127.0.0.1, ident: '-' }

Option

var ltsv = new ltsv2json(option);
  • {stringify: false}: emit json object (default)
  • {stringify: true}: emit json string

License

MIT

Author

Jxck https://github.com/Jxck

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free