Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/geometryzen/davinci-csv
- Owner: geometryzen
- License: other
- Created: 2017-02-21T04:32:12.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-03-24T12:31:36.000Z (8 months ago)
- Last Synced: 2024-10-31T18:56:02.585Z (15 days ago)
- Language: TypeScript
- Size: 1.13 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
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`)
}
}
```