node package manager

find-in-csv

find-in-csv

Easy way finding a row in a CSV.

Linux Windows
master
develop

NPM

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' 
        }
    }
);