0.1.3 • Published 1 year ago

json-tree-text-generator v0.1.3

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

JSON Tree Text Generator

A Node.js library that provides a function to generate text-based tree representations of JSON objects.

Installation

npm install json-tree-text-generator

Usage

const jsonTreeTextGenerator = require('json-tree-text-generator');

const sample = {
    Assets: {
        thirdParty: {
            CompanyName: {
                PackageName: {
                    Version: null,
                    PackageName: null
                }
            }
        },
        Art: {
            Animation: {
                AnimationClips: null,
                Animators: null
            },
            Audio: {
                AudioClips: null,
                AudioMixers: null
            }
        },
        Documentation: null,
        Settings: null
    }
};

const treeText = jsonTreeTextGenerator.generateTreeText(sample);

console.log(treeText);

Output:

└── Assets
    ├── thirdParty
    │   └── CompanyName
    │       └── PackageName
    │           ├── Version
    │           └── PackageName
    ├── Art
    │   ├── Animation
    │   │   ├── AnimationClips
    │   │   └── Animators
    │   └── Audio
    │       ├── AudioClips
    │       └── AudioMixers
    ├── Documentation
    └── Settings

Features

  • Supports nested JSON objects
  • Configurable indentation
  • Configurable output format
0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago