log-csv-stream

0.1.0 • Public • Published

Build Status Dependency Status

log-csv-stream

Designed to work with https://github.com/robertkowalski/temperature-stream, but you can log all values as CSV

  var csv = csvLog()
  var target = fs.createWriteStream(__dirname + '/temp.txt')
  fs.createReadStream(__dirname + '/input.txt')
    .pipe(csv)
    .pipe(target) // 1373750981527;22570\n

You can define delimiter and line-end:

  var csv = csvLog(',', '|')
  var target = fs.createWriteStream(__dirname + '/temp.txt')
  fs.createReadStream(__dirname + '/input.txt')
    .pipe(csv)
    .pipe(target) // 1373750981527,22570|

You can even use custom timestamps! This is so amazing!

  var csv = csvLog(';', '\n', new Date().toString())
  var target = fs.createWriteStream(__dirname + '/temp.txt')
  fs.createReadStream(__dirname + '/input.txt')
    .pipe(csv)
    .pipe(target) // So Jul 14 2013 12:32:33 GMT+0200 (CEST);22570\n

/log-csv-stream/

    Package Sidebar

    Install

    npm i log-csv-stream

    Weekly Downloads

    1

    Version

    0.1.0

    License

    BSD

    Last publish

    Collaborators

    • robertkowalski