{"id":15355516,"url":"https://github.com/mattipv4/tree-parse","last_synced_at":"2025-04-15T06:29:15.055Z","repository":{"id":51389643,"uuid":"248074319","full_name":"MattIPv4/tree-parse","owner":"MattIPv4","description":"A super simple package to parse the string output of the unix tree command into an object.","archived":false,"fork":false,"pushed_at":"2023-07-19T02:20:04.000Z","size":85,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T17:05:59.551Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/tree-parse","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MattIPv4.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-17T21:13:21.000Z","updated_at":"2023-11-17T12:36:24.000Z","dependencies_parsed_at":"2024-10-16T03:31:08.799Z","dependency_job_id":null,"html_url":"https://github.com/MattIPv4/tree-parse","commit_stats":{"total_commits":22,"total_committers":2,"mean_commits":11.0,"dds":"0.18181818181818177","last_synced_commit":"894fcca4b594179f4cffc0a35119550894a4de43"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MattIPv4%2Ftree-parse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MattIPv4%2Ftree-parse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MattIPv4%2Ftree-parse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MattIPv4%2Ftree-parse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MattIPv4","download_url":"https://codeload.github.com/MattIPv4/tree-parse/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249020253,"owners_count":21199521,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T12:24:39.001Z","updated_at":"2025-04-15T06:29:15.032Z","avatar_url":"https://github.com/MattIPv4.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tree-parse\n\nA super simple package to parse the string output of the unix tree command into an object.\n\n---\n\nUse the `parse` function to convert the output of the unix `tree` command into an object.\nThe object will contain keys for each file or directory found.\n\nEach file will have a value that is an empty object,\nwith each directory's value being an object containing all its children.\n\nUse the `files` function to convert the output of the `tree` function into a single array of files, as strings.\n\n---\n\n```javascript\nconst { parse } = require('tree-parse');\n\nconst demo = `\n.\n├── README.md\n├── example.png\n├── package-lock.json\n├── package.json\n├── src\n│   ├── app.js\n│   ├── util.js\n│   └── test\n│       └── test.js\n└── index.js\n\n2 directories, 8 files\n`;\n\nconst tree = parse(demo);\nconsole.log(tree);\n```\n\n```json\n{\n    \".\": {\n        \"README.md\": {},\n        \"example.png\": {},\n        \"package-lock.json\": {},\n        \"package.json\": {},\n        \"src\": {\n            \"app.js\": {},\n            \"util.js\": {},\n            \"test\": {\n                \"test.js\": {}\n            }\n        },\n        \"index.js\": {}\n    }\n}\n```\n\n```javascript\nconst { parse, files } = require('tree-parse');\n\nconst demo = `\n.\n├── README.md\n├── example.png\n├── package-lock.json\n├── package.json\n├── src\n│   ├── app.js\n│   ├── util.js\n│   └── test\n│       └── test.js\n└── index.js\n\n2 directories, 8 files\n`;\n\nconst tree = parse(demo);\nconst list = files(tree);\nconsole.log(list);\n```\n\n```json\n[\n    \"./README.md\",\n    \"./example.png\",\n    \"./package-lock.json\",\n    \"./package.json\",\n    \"./src/app.js\",\n    \"./src/util.js\",\n    \"./src/test/test.js\",\n    \"./index.js\"\n]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattipv4%2Ftree-parse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattipv4%2Ftree-parse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattipv4%2Ftree-parse/lists"}