0.1.3 • Published 11 years ago

csv-table v0.1.3

Weekly downloads
5
License
MIT
Repository
github
Last release
11 years ago

CSV-Table

Build Status

Install

$ npm install -g csv-table

CLI

$ csv-table [options] <file ...>

Options

-h, --help                  output usage information
-V, --version               output the version number
-d, --delimiter <value>     Sets the delimiter, defaults to ';'
-c, --columns               Use CSV columns headers
-t, --trim                  trim values
-l, --ltrim                 left trim values
-r, --rtrim                 right trim values
-s, --skip                  skip empty lines
-q, --quote <value>         Quote character, defaults to '"'
-m, --comment <value>       Comment character, default is none
-e, --escape <value>        Escape character, default is '"'
-r, --rowDelimiter <value>  Row delimiter character, default is '\n'

API

var csvTable = require( "csv-table" );

csvTable( csv_file [, options] [, callback] );

// Example:
csvTable( "./data.csv", { columns: true }, function( table, obj ) {
	// table is the string representation of the table
	console.log( table );

	// obj is the object representation of the tablified csv
	console.log( obj );
});

If no callback is given, it prints the table to the console/stdout.

Options:

With default values:

{
	delimiter: ';',
	columns: false,
	trim: false,
	ltrim: false,
	rtrim: false,
	skip_empty_values: false,
	quote: '"'
	comment: '',
	escape: '"',
	rowDelimiter: '\n'
}

Contributing:

Check out the contributing file

0.1.3

11 years ago

0.1.2

11 years ago

0.1.1

11 years ago

0.0.1

11 years ago