0.0.5 • Published 7 months ago
linux-treegen v0.0.5
linux-treegen
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.