Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/gko/csvy

⚗ yaml/json converter to csv
https://github.com/gko/csvy

csv json node yaml

Last synced: 28 days ago
JSON representation

⚗ yaml/json converter to csv

Awesome Lists containing this project

README

        

# CSVy
![build](https://travis-ci.org/gko/csvy.svg?branch=master)
[![Coverage Status](https://coveralls.io/repos/github/gko/csvy/badge.svg?branch=master)](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