csv-headers

1.0.0 • Public • Published

csv-headers

Returns an array containing those elements which are present in first array and not in others

Installation

$ npm install csv-headers

Usage

var csvHeaders = require('csv-headers');
 
// Various options are:
// file      : Mandatory, Absolute path of file : specified in quotes
// delimiter : Optional, Specify the delimiter between various fields, defaults to comma(,)
// encoding  : Optional, Specify the file encoding, defaults to 'utf8'
 
var options = {
    file      : 'absoulte file path',
    delimiter : ','
};
 
csvHeaders(options, function(err, headers) {
    if(!err)
        console.log(headers);
});
//=> ['title', 'salary', 'city', 'state']

License

MIT © Gaurav Luthra

Package Sidebar

Install

npm i csv-headers

Weekly Downloads

216

Version

1.0.0

License

MIT

Last publish

Collaborators

  • gluthra