Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/geometryzen/davinci-csv

Comma Separated Value (CSV) Library for JavaScript with TypeScript d.ts files.
https://github.com/geometryzen/davinci-csv

Last synced: 9 days ago
JSON representation

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

Awesome Lists containing this project

README

        

# davinci-csv
Comma Separated Value (CSV) Library for JavaScript with TypeScript d.ts files.

## Example.

```typescript
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`)
}
}
```