Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shinshin86/csv-parse-v
ES Modules style CSV Parser
https://github.com/shinshin86/csv-parse-v
csv-parser esm esmodules
Last synced: 28 days ago
JSON representation
ES Modules style CSV Parser
- Host: GitHub
- URL: https://github.com/shinshin86/csv-parse-v
- Owner: shinshin86
- License: mit
- Created: 2022-08-16T02:04:15.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-13T22:33:20.000Z (about 2 years ago)
- Last Synced: 2024-11-29T00:04:13.097Z (about 1 month ago)
- Topics: csv-parser, esm, esmodules
- Language: JavaScript
- Homepage:
- Size: 242 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# csv-parse-v
[![Test](https://github.com/shinshin86/csv-parse-v/actions/workflows/test.yml/badge.svg)](https://github.com/shinshin86/csv-parse-v/actions/workflows/test.yml)![logo](./logo/logo.png)
ES Modules style CSV Parser
## Install
```sh
# npm
npm i --save csv-parse-v# yarn
yarn add csv-parse-v# pnpm
pnpm add csv-parse-v# bun
bun install csv-parse-v
```## Usage
```javascript
import parse from 'csv-parse-v';const csv = `id,title,text,createdAt,updatedAt
1,foo,bar,2022-01-01T00:00:00.000Z,2022-01-02T23:59:59.123Z
2,foo2,bar2💨,2022-02-01T00:00:00.000Z,2022-02-02T23:59:59.123Z`;const result = parse(csv);
console.log(result);
```For use within HTML (use `esm` sample).
```html
// Use esm.sh
import parse from 'https://esm.sh/csv-parse-v';const csv = `id,title,text,createdAt,updatedAt
1,foo,bar,2022-01-01T00:00:00.000Z,2022-01-02T23:59:59.123Z
2,foo2,bar2💨,2022-02-01T00:00:00.000Z,2022-02-02T23:59:59.123Z`;const result = parse(csv);
alert(JSON.stringify(result));
```
![demo image](./demo/csv-parse-v_demo.png)
### Deno
This is a sample for use with Deno.
(Deno version must be `1.25` or higher.)```typescript
import parse from "npm:csv-parse-v";const csv = `id,title,text,createdAt,updatedAt
1,foo,bar,2022-01-01T00:00:00.000Z,2022-01-02T23:59:59.123Z
2,foo2,bar2💨,2022-02-01T00:00:00.000Z,2022-02-02T23:59:59.123Z`;const result = parse(csv);
console.log(result);
```## Development
### Test
```sh
npm run test
```### Code format
Use `deno fmt`.
```sh
npm run fmt
```## License
[MIT](https://github.com/shinshin86/csv-parse-v/blob/main/LICENSE)
## Author
[Yuki Shindo](https://shinshin86.com/en)