davinci-csv
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

davinci-csv

Comma Separated Value (CSV) Library for JavaScript with TypeScript d.ts files.

Example.

import {parse, Dialect, Field} from 'davinci-csv'

/**
 * Parse CSV from the contents of a script tag with the specified identifier.
 */
function csvFromScriptElementId(id: string, dialect?: Dialect): Field[][] {
    const dataElement = document.getElementById(id)
    if (dataElement) {
        const csvText = dataElement.innerText
        return parse(csvText, dialect)
    }
    else {
        throw new Error(`${id} is not a valid element id`)
    }
}

Readme

Keywords

Package Sidebar

Install

npm i davinci-csv

Weekly Downloads

8

Version

1.0.4

License

MIT

Unpacked Size

298 kB

Total Files

16

Last publish

Collaborators

  • geometryzen