w-data-csv

1.0.6 • Public • Published

w-data-csv

A tool for csv data.

language npm version license gzip file size npm download npm download jsdelivr download

Documentation

To view documentation or get support, visit docs.

Installation

Using npm(ES6 module):

Note: w-data-csv is mainly dependent on csv-parser and strip-bom-stream.

npm i w-data-csv

Example for read:

Link: [dev source code]

import wdc from './src/WDataCsv.mjs'

let fp = './g-test-in.csv'
wdc.readCsv(fp)
    .then((ltdt) => {
        console.log(ltdt)
        // => [ { NAME: 'Daffy Duck', AGE: '24' }, { NAME: 'Bugs 邦妮', AGE: '22' } ]
    })
    .catch((err) => {
        console.log(err)
    })

Example for write:

Link: [dev source code]

import wdc from './src/WDataCsv.mjs'

let ltdt = [{ name: '大福 Duck', value: 2.4 }, { name: 'Bugs 邦妮', value: '2.2' }]
let fp = './g-test-out.csv'
wdc.writeCsv(fp, ltdt)
    .then((res) => {
        console.log(res)
        // => finish
    })
    .catch((err) => {
        console.log(err)
    })

/w-data-csv/

    Package Sidebar

    Install

    npm i w-data-csv

    Weekly Downloads

    0

    Version

    1.0.6

    License

    MIT

    Unpacked Size

    1.3 MB

    Total Files

    58

    Last publish

    Collaborators

    • semisphere