0.0.2 • Published 7 years ago

@concierge-auctions/csv-parser v0.0.2

Weekly downloads
2
License
GPL-3.0
Repository
-
Last release
7 years ago

Most of the credit goes to csvtojson. This package is a thin wrapper on top of csvtojson tailored to our anticipated use cases.

Features

  • Promise API
  • Transform column names
  • Returns JS object or JSON string
  • Parse CSV from a string or file
  • Non-blocking (5-6ms ticks on average)
  • Don't lose the configurability of csvtojson

Future concerns:

  • Blocking for "data" path (split and reverse). The cost of this isn't terribly high, but could become a concern with larger datasets. (~70ms for 200k lines @ 25 columns)
  • columnNameMapper option (function) so that we could pass in a toCamelCase function or something.
  • columnTypeMapper map function for each value (integer for some columns, date for others)
  • Allow a stream to be passed in instead a string of filename Check out tests for usage examples