linux-treegen
v0.0.5
Published
A simple tree generator from JSON
Readme
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-treegenUsing yarn
yarn add linux-treegenUsage
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
└── 3License
This project is licensed under the MIT License. See the LICENSE file for more details.
