npm.io
0.0.3 • Published 3 years ago

@csv-js/csv

Licence
MIT
Version
0.0.3
Deps
2
Size
10 kB
Vulns
0
Weekly
0
Stars
2

CsvJs

A js library specialized in processing csv data.

Features

  • Parse csv format
  • Serialized csv format
  • Csv data CRUD
  • Browser download csv

︎ Packages

  • @csv-js/csv A class specialized in processing csv data.
  • @csv-js/core The core module for processing csv.
  • @csv-js/type Generic types for csv-js packsge.

Usage

Install
npm install @csv-js/csv --save
Example
import Csv from '@csv-js/csv'

const header = [
  {
    key: 'name',
    label: 'Name'
  },
  {
    key: 'age',
  }
]
const csv = new Csv(header, { name: 'test' })

csv.append([
  {
    name: 'eddie',
    age: 20
  },
  {
    name: 'jojo',
    age: 18
  }
])

csv.toString() // 'Name,age\r\neddie,20\r\njojo,18'

// Browser download csv
csv.download()

Documentation

To be perfected.

License

Licensed under the MIT License.

Keywords