https://github.com/jlarky/csv-parse
Dead simple to use CSV parser
https://github.com/jlarky/csv-parse
Last synced: 10 months ago
JSON representation
Dead simple to use CSV parser
- Host: GitHub
- URL: https://github.com/jlarky/csv-parse
- Owner: JLarky
- Created: 2024-06-13T00:43:44.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-13T01:28:52.000Z (over 1 year ago)
- Last Synced: 2025-01-11T13:14:31.497Z (12 months ago)
- Language: TypeScript
- Homepage: https://jsr.io/@jlarky/csv-parse
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @jlarky/csv-parse [](https://jsr.io/@jlarky/csv-parse)
## Installation
```bash
bunx jsr add @jlarky/csv-parse
# or
npx jsr add @jlarky/csv-parse
```
## Example
```jsx
import { parse } from "@jlarky/csv-parse";
const input = "a,b,c\n1,2,3\n4,5,6";
const options = { columns: true };
const result = await parse(input, options);
if (result.success) {
console.log(result.records);
} else {
console.error(result.err);
}
```
## Browser
```js
const { parse } = await import("https://esm.sh/jsr/@jlarky/csv-parse@latest");
await parse("123,456")
```
## Development
To install dependencies:
```bash
bun install
```
To test:
```bash
bun test
```
To publish:
```bash
bun run publish
```