Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-oser committed Mar 6, 2022
1 parent 06f7790 commit 221c885
Showing 1 changed file with 27 additions and 18 deletions.
45 changes: 27 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,43 @@ This repo contains the tree parsing functions which are used in multiple repos t
## treeStringToJson
This parses a tree output into JSON for further use. Sample JSON format is below. Node names are stored in the keys and children are stored as an object in the value.
```json
{
"AboutView": {
"index.tsx": {},
"style.ts": {},
"test.tsx": {}
[
{
"name": "AboutView",
"children": [],
},
"App": {
"Header": {
"index.tsx": {}
},
"index.tsx": {},
"style.ts": {},
"test.tsx": {}
{
"name": "App",
"children": [
{
"name": "Header",
"children": [
{
"name": "index.tsx",
"children": [],
}
]
},
{
"name": "index.tsx",
"children": [],
},
{
"name": "style.ts",
"children": [],
}
]
}
}
]
```

## treeJsonToString
This is used to convert the JSON back to a formatted string for logging or storing in a file.
```tree
├── AboutView
│ ├── index.tsx
│ ├── style.ts
│ └── test.tsx
└── App
├── Header
│ └── index.tsx
├── index.tsx
├── style.ts
└── test.tsx
└── style.ts
```

0 comments on commit 221c885

Please sign in to comment.