Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jlarky/csv-parse
Dead simple to use CSV parser
https://github.com/jlarky/csv-parse
Last synced: about 1 month 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 (7 months ago)
- Default Branch: main
- Last Pushed: 2024-06-13T01:28:52.000Z (7 months ago)
- Last Synced: 2024-06-14T05:35:57.060Z (7 months ago)
- Language: TypeScript
- 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 [![JSR](https://jsr.io/badges/@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
```