Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

olivierkaisin/node-csv-query

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-csv-query Build Status

Turn your CSV files to queryable objects.

How to use

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

Credits

  • bluebird
  • csv-parse
  • lodash
  • event-stream

License

MIT

About

Turn your CSV files to queryable objects

Resources

Stars

Watchers

Forks

Packages

No packages published