Skip to content

gko/csvy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CSVy

build Coverage Status

yaml/json → csv

Flattens fields and arrays:

{
  "name": {
    "first": "John",
    "last": "Snow"
  },
  "tags": ["first", "second", "last"]
}

turns to:

"name.first","name.last","tags.0","tags.1","tags.2"
"John","Snow","first","second","last"

Installation

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>  delimiter symbol
    -o, --output <file>          output file

examples:

csvy -o test.csv ./test.json
curl -L https://raw.githubusercontent.com/gko/csvy/master/test/test.yml | csvy

You can also use it from node:

const convert = require('csvy');

convert(`{"a":1}`, {delimiter: ';'})

Tests

To run tests you simply need to do:

npm run test

Like it?

⭐ this repo

License

MIT

Copyright (c) 2017 Konstantin Gorodinskiy

About

⚗ yaml/json converter to csv

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published