Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/gko/csvy
- Owner: gko
- License: mit
- Created: 2017-01-15T21:39:04.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-01-23T18:03:42.000Z (about 8 years ago)
- Last Synced: 2024-11-08T20:49:19.788Z (3 months 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
![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: ';'})
```
## TestsTo 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