Fetch and parse ranges of CSV file.
This is an early version. The API may change completely:
- until version 0.1.0, breaking changes may be introduced at any time.
- from version 0.1.0 to 1.0.0, breaking changes will be introduced only in minor versions.
- from version 1.0.0, breaking changes will be introduced only in major versions.
npm install csv-rangeTo parse a remote CSV file from a URL:
import { parseURL } from 'csv-range'
const rows = []
for await (const { row } of parseURL('https://data.source.coop/severo/csv-papaparse-test-files/sample.csv')) {
rows.push(row)
}
console.log(rows)
// Output: [ [ 'A', 'B', 'C' ], [ 'X', 'Y', 'Z' ] ]The code is heavily inspired by Papaparse.
It has partly been funded by source.coop.