csvy

0.5.0 • Public • Published

CSVy

build

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:

csv -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

License

MIT

Copyright (c) 2016 Konstantin Gorodinskiy

Readme

Keywords

Package Sidebar

Install

npm i csvy

Weekly Downloads

0

Version

0.5.0

License

MIT

Last publish

Collaborators

  • konstantin