Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

json2csv

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json2csv

  • 0.0.4
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

json2csv

Simple tool for converting JSON to CSV

Status

Gem Version Downloads Build Status Code Climate Dependency Status Coverage Status

Getting started

gem install json2csv

Usage

Simple conversion

json2csv convert data/sample.json

Global help

json2csv help
NAME
    json2csv - json2csv 0.0.3

SYNOPSIS
    json2csv [global options] command [command options] [arguments...]

GLOBAL OPTIONS
    --help - Show this message

COMMANDS
    convert - Convert json file
    help    - Shows a list of commands or help for one command
    version - Print version info

Convert help

json2csv help convert
NAME
    convert - Convert json file

SYNOPSIS
    json2csv [global options] convert [command options]

COMMAND OPTIONS
    -d, --delimiter=arg - (default: ,)
    -r, --root=arg      - (default: none)

Example

Input json

cat data/sample.json

{
    "12345": {
        "Firstname": "Joe",
        "Lastname": "Doe",
        "Address": {
            "Street": "#2140 Taylor Street, 94133",
            "City": "San Francisco",
            "Details": {
                "Note": "Pool available"
            }
        }
    },

    "45678": {
        "Firstname": "Jack",
        "Lastname": "Plumber",
        "Address": {
            "Street": "#111 Sutter St, 94104",
            "City": "San Francisco",
            "Details": {
                "Note": "Korean Deli near to main entrance"
            }
        }
    }
}

Convert JSON

json2csv convert data/sample.json
Converting data/sample.json

Output CSV

cat data/sample.json.csv

id,Firstname,Lastname,Address.Street,Address.City,Address.Details.Note
12345,Joe,Doe,"#2140 Taylor Street, 94133",San Francisco,Pool available
45678,Jack,Plumber,"#111 Sutter St, 94104",San Francisco,Korean Deli near to main entrance

FAQs

Package last updated on 30 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc