Turn your CSV files to queryable objects.
dataset.csv
id,firstName,lastName,amountOfBooks
1,Olivier,Kaisin,10
2,Emile-Victor,Portenart,2
3,Alex,Mapolice,42
4,Alex,Gaspy,2
How to find the row with firstName=Olivier
"use strict";
var csv = require("csv-query");
csv.createFromFile(
__dirname + "/dataset.csv", {
delimiter: ";"
}).then(function (db) {
return db.findOne({
firstName: "Olivier"
});
}).then(function (record) {
// Do some stuff
}).catch(function (error) {
throw error;
});
- bluebird
- csv-parse
- lodash
- event-stream
MIT