An open API service indexing awesome lists of open source software.

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.

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)
})
```