https://github.com/javarome/csv4json
Converts CSV to JSON, and vice versa.
https://github.com/javarome/csv4json
conversion csv csv-parser json json-parser
Last synced: 4 months ago
JSON representation
Converts CSV to JSON, and vice versa.
- Host: GitHub
- URL: https://github.com/javarome/csv4json
- Owner: Javarome
- Created: 2023-12-12T22:20:31.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-15T17:07:57.000Z (almost 2 years ago)
- Last Synced: 2025-02-14T12:51:11.668Z (about 1 year ago)
- Topics: conversion, csv, csv-parser, json, json-parser
- Language: JavaScript
- Homepage:
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# csv4json
Converts CSV to JSON, and vice versa.
Vanilla JS, no dependencies.
## Setup
Either install it globally:
```
npm install -g @javarome/csv4json
```
or locally:
```
npm install @javarome/csv4json
```
## Usage
### CLI
```
csv4json --input --output
````
### API
#### Convert file
```js
const converter = new Csv4Json('../test/input.csv', '../test/output.json', ',', '\n')
converter.run().then(result => {
console.log('Written', result)
})
```
#### Convert contents
```js
const converter = new Csv4Json('../test/input.csv', '../test/output.json', ',', '\n')
converter.run().then(result => {
console.log('Written', result)
})
```