2.0.2 • Published 8 months ago

@kessler/csv-splitter v2.0.2

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
8 months ago

@kessler/csv-splitter

A tool for splitting csv files.

Can be used from command line or programmatically.

Each page will end with two newlines. For a csv with headers, each page will begin with the headers.

cli install

  npm i -g @kessler/csv-splitter

cli usage

csv with headers

split 4 rows into pages of 2 rows

  $ echo id,name\n1,foo\n2,bar\n3,blip\n4,blamp | node index.mjs -s 2
  id,name
  1,foo
  2,bar

  id,name
  3,blip
  4,blamp

csv without headers

split 4 rows into pages of 2 rows

  $ echo 1,foo\n2,bar\n3,blip\n4,blamp | node index.mjs -s 2 --noHeaders
  1,foo
  2,bar

  3,blip
  4,blamp⏎

module install

  npm i @kessler/csv-splitter

module usage

  import csvSplit from '@kessler/csv-splitter'

  async function main() {
    await csvSplit(process.stdin, process.stdout, { size: 100 })
  }

  main()
2.0.2

8 months ago

2.0.1

9 months ago

2.0.0

9 months ago

1.0.0

9 months ago