linux-treegen is a lightweight Typescript library for generating folder-like tree structures, inspired by the Linux tree command.
- Dynamically generate tree structures for nested JSON objects.
- Supports any level of nested structures.
npm install linux-treegenyarn add linux-treegenimport { 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);├── package.json
├── README.md
└── src
├── 1
├── 2
└── 3
This project is licensed under the MIT License. See the LICENSE file for more details.