Fast and reliable CSV parser based on PapaParse
npm install babyparse
|1||downloads in the last week|
|6||downloads in the last month|
|Version||0.1.0 last updated a month ago|
|Keywords||csv, parse, parsing, parser, delimited, text, data, auto-detect, comma, tab, pipe, file, filereader, stream|
I needed a really fast and reliable CSV parser. PapaParse.com is the best one I've come across yet. But it's wrapped up as a jQuery plugin like it's 2006 or something :P
So I stripped out the actual parsing bit and made it Node/AMD compatible, so that I could drop it into non-jQuery projects. The code hasn't been touched other than that - I think there's a load of logic for handling streams and whatnot. I honestly don't know and can't be bothered to look. It seems pretty decent. In the project I'm working on now it was an order of magnitude quicker than the thicket of regex hacks it replaced.
Don't thank me, thank @mholt. (Thanks Matt!)
// see http://papaparse.com/docs.html for config options parser = new Parser( config ); // pass in the contents of a csv file parsed = parser.parse( csv ); // voila rows = parser.results.rows;
The original PapaParse is MIT licensed. So is BabyParse.