https://github.com/gko/csvy
⚗ yaml/json converter to csv
https://github.com/gko/csvy
csv json node yaml
Last synced: about 1 year ago
JSON representation
⚗ yaml/json converter to csv
- Host: GitHub
- URL: https://github.com/gko/csvy
- Owner: gko
- License: mit
- Created: 2017-01-15T21:39:04.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-01-23T18:03:42.000Z (about 9 years ago)
- Last Synced: 2025-02-16T00:41:21.547Z (about 1 year ago)
- Topics: csv, json, node, yaml
- Language: JavaScript
- Size: 29.3 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CSVy

[](https://coveralls.io/github/gko/csvy?branch=master)
yaml/json → csv
Flattens fields and arrays:
```json
{
"name": {
"first": "John",
"last": "Snow"
},
"tags": ["first", "second", "last"]
}
```
turns to:
```csv
"name.first","name.last","tags.0","tags.1","tags.2"
"John","Snow","first","second","last"
```
## Installation
```bash
npm i csvy -g
```
## Usage
```
Usage: csvy [options]
yaml/json converter to csv
Options:
-h, --help output usage information
-V, --version output the version number
-d, --delimiter delimiter symbol
-o, --output output file
```
examples:
```bash
csvy -o test.csv ./test.json
```
```bash
curl -L https://raw.githubusercontent.com/gko/csvy/master/test/test.yml | csvy
```
You can also use it from node:
```javascript
const convert = require('csvy');
convert(`{"a":1}`, {delimiter: ';'})
```
## Tests
To run tests you simply need to do:
```bash
npm run test
```
## Like it?
:star: this repo
## License
[MIT](http://opensource.org/licenses/MIT)
Copyright (c) 2017 Konstantin Gorodinskiy