1.0.4 • Published 2 years ago

@livy/csv-formatter v1.0.4

Weekly downloads
4
License
MIT
Repository
github
Last release
2 years ago

@livy/csv-formatter

This Livy formatter formats log records as CSV lines.

Basic Example

const { FileHandler } = require('@livy/file-handler')
const { CsvFormatter } = require('@livy/csv-formatter')

const handler = new FileHandler('logs.csv', {
  formatter: new CsvFormatter()
})

Installation

Install it via npm:

npm install @livy/csv-formatter

Options

An object of options can be passed to this formatter's constructor.

The following options are available:

delimiter

Type: string

Default: ','

Description: The delimiter to separate columns.

enclosure

Type: string

Default: '"'

Description: The string to enclose fields.

eol

Type: string

Default: '\r\n'

Description: The line terminator string.

generateFields

Type: function

Default: A generator which includes date/time (as ISO 8601 string), log level, message, and JSON-serialized context and extra objects.

Description: A function to map each log record to an array of strings which represent the fields of each CSV line.

1.0.4

2 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago