find-in-csv
v0.1.0
Published
Easy way finding the rows in a CSV.
Downloads
5
Readme
find-in-csv
Easy way finding a row in a CSV.
Install
$ npm install --save find-in-csv
Usage
var FindInCsv = require('find-in-csv');
var findInCsv = new FindInCsv( '/path/to/your.csv' );
/*
id,pw,name,prof
a,b,hoge,fuga
*/
findInCsv.get(
{'id':'a', 'pw':'b'},
function(result){
console.log(result['id']); // a
console.log(result['pw']); // b
console.log(result['name']); // hoge
console.log(result['prof']); // fuga
}
);
Options
var FindInCsv = require('find-in-csv');
var findInCsv = new FindInCsv(
'/path/to/your.csv',
{
"require": ['head1', 'head2'],
"encrypted": {
"pw": "sha1" // 'sha1' | 'md5'
}
}
);