New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

json-flat-select

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-flat-select

Map deep json structures selectively to csv.

  • 1.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

JSON select to CSV

Map deep json structures selectively to a flat object. Root object needs to be an object not an array. Can be called in command line to and supports parsing flat file to csv

Install

npm install -g json-flat-select

Map.json

{
  "name": "name", //address a root property
  "age": "info.more.age" // access sub property, '' if not defined
  "result1": "results[0].value" // access index, '' if out of range
  "resultFallback": ["results[0].value","results[0].error"] // if not defined will attempt to resolve second
}

Command Line Usage

json-flat-select ./**/*.json pathToRowMapFile > data.json
json-flat-select ./**/*.json pathToRowMapFile ',' > data.csv
json-flat-select ./**/*.json pathToRowMapFile '\t' > data.tsv

Module Usage

var jsonFlatSelect = require('json-flat-select')
var rowMap = require('PUT_PATH_TO_ROW_MAP_HERE.json')

var csvTable = jsonFlatSelect('*.json', rowMap)

Test

npm test

FAQs

Package last updated on 21 Mar 2018

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