0.2.2 • Published 2 years ago

naivecsv v0.2.2

Weekly downloads
7
License
MIT
Repository
github
Last release
2 years ago

naivecsv

npm version npm download monthly npm download total npm dependents npm license pp install size github commit last github commit total

//: <> (Shields)

//: <> (Link)

A light and simple csv parser.

Highlights

  • Customizable delimiter(default: ','), line-feed(default: '\x\n') and quote-mark(default: '\"')
  • Decoding configurable
  • Transpose available
  • Can delete blank trailing row
  • Static method under class NaiveCsv

Install

$ npm install naivecsv

Usage

import { NaiveCsv } from 'naivecsv'
import { promises as fsPromise } from 'fs'

const file='[your csv file directory]'

// simple usage
fsPromise
  .readFile(file, 'utf-8')
  .then(text => {
    console.log(NaiveCsv.toRows(text, { popBlank: true }))
  })

// more features
fsPromise
  .readFile(file)
  .then(text => {
    console.log(
      NaiveCsv.toRows(text, {
        de: ',', // delimiter
        lf: '\x\n', // line-feed
        qt: '\"', // quotation mark
        transpose: false, // transpose the entire csv text as 2-d array
        decode: 'utf-8', // appoint decoding as 'utf-8'
        popBlank: true // delete blank trailing row
      }))
  })

License

MIT

Copyright (y) 2019-present, Haoyang (Vincent) Wang

0.2.2

2 years ago

0.2.1

3 years ago

0.2.0

4 years ago

0.1.0

4 years ago

0.0.39

4 years ago

0.0.38

4 years ago

0.0.37

4 years ago

0.0.36

4 years ago

0.0.35

4 years ago

0.0.32

4 years ago

0.0.33

4 years ago

0.0.31

4 years ago

0.0.30

4 years ago

0.0.28

4 years ago

0.0.29

4 years ago

0.0.27

4 years ago

0.0.26

4 years ago

0.0.25

4 years ago

0.0.24

4 years ago

0.0.23

4 years ago

0.0.21

4 years ago

0.0.20

4 years ago

0.0.19

4 years ago

0.0.18

4 years ago

0.0.17

4 years ago

0.0.16

4 years ago

0.0.13

4 years ago

0.0.12

4 years ago

0.0.11

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.1

4 years ago