JSPM

jsonfieldexplorer

0.1.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 15
  • Score
    100M100P100Q35309F
  • License ISC

Node.js tool to efficiently explore and list all field paths in a JSON object. Perfect for understanding complex JSON structures, it recursively analyzes JSON data to provide a clear summary of nested fields and arrays.

Package Exports

  • jsonfieldexplorer
  • jsonfieldexplorer/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (jsonfieldexplorer) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

JsonFieldExplorer (jfe)

Description

JsonFieldExplorer (jfe) is a command-line tool that simplifies the exploration of JSON data structures. It analyzes JSON files and lists all possible field paths, aiding in understanding and navigating complex JSON objects. This tool is especially useful for developers and data analysts working with large and nested JSON files.

Installation

To install JsonFieldExplorer, use npm:

npm install -g jsonfieldexplorer

This will install jfe globally on your system, allowing you to use it from any directory.

Usage

To use jfe, simply pass the path of your JSON file as an argument:

jfe path/to/yourfile.json

You can also pipe in JSON.

$ echo '{"a": [{"b": true}]}' | jfe
a
a[].b

Examples

Given a JSON file like this:

{
  "organization": {
    "name": "OpenAI",
    "location": "San Francisco",
    "departments": [
      {
        "name": "Research",
        "employees": 100
      },
      {
        "name": "Engineering",
        "employees": 80
      }
    ]
  }
}

Running jfe on this file would produce output similar to the following:

organization.name
organization.location
organization.departments[].name
orgrnization.departments[].employees

This output indicates that the JSON file contains fields for the organization's name and location, as well as an array of departments, each with its own name and number of employees.

License

This project is licensed under the ISC License - see the LICENSE.md file for details.