0.0.5 • Published 7 months ago

linux-treegen v0.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

linux-treegen

npm version npm downloads License: MIT

linux-treegen is a lightweight Typescript library for generating folder-like tree structures, inspired by the Linux tree command.

Features

  • Dynamically generate tree structures for nested JSON objects.
  • Supports any level of nested structures.

Installation

Using npm

npm install linux-treegen

Using yarn

yarn add linux-treegen

Usage

import { treegen } from 'linux-treegen';

const jsonStructure = [
  { "name": "package.json" },
  { "name": "README.md" },
  {
    "name": "src",
    "children": [
        { "name": "1" },
        { "name": "2" },
        { "name": "3" },
    ],
  },
];

const tree = treegen(jsonStructure);
console.log(tree);

Output

├── package.json
├── README.md
└── src
    ├── 1
    ├── 2
    └── 3

License

This project is licensed under the MIT License. See the LICENSE file for more details.

0.0.5

7 months ago

0.0.4

7 months ago

0.0.3

7 months ago

0.0.2

7 months ago

0.0.1

7 months ago