{"id":19887974,"url":"https://github.com/zakarialaoui10/dir2tree","last_synced_at":"2025-07-25T21:33:41.451Z","repository":{"id":202814639,"uuid":"655385414","full_name":"zakarialaoui10/dir2tree","owner":"zakarialaoui10","description":"a user-friendly Node.js tool for creating organized json tree from a root directory .","archived":false,"fork":false,"pushed_at":"2025-03-06T22:39:26.000Z","size":75030,"stargazers_count":29,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-02T01:40:28.293Z","etag":null,"topics":["automation","github-actions","javascript","json","morocco","nodejs","tree-structure"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zakarialaoui10.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,"zenodo":null}},"created_at":"2023-06-18T18:25:03.000Z","updated_at":"2025-05-08T12:39:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"c030094f-523a-4699-aebe-aa92fee2e8f2","html_url":"https://github.com/zakarialaoui10/dir2tree","commit_stats":null,"previous_names":["zakarialaoui10/dir2tree"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/zakarialaoui10/dir2tree","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zakarialaoui10%2Fdir2tree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zakarialaoui10%2Fdir2tree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zakarialaoui10%2Fdir2tree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zakarialaoui10%2Fdir2tree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zakarialaoui10","download_url":"https://codeload.github.com/zakarialaoui10/dir2tree/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zakarialaoui10%2Fdir2tree/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267065443,"owners_count":24030384,"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","status":"online","status_checked_at":"2025-07-25T02:00:09.625Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["automation","github-actions","javascript","json","morocco","nodejs","tree-structure"],"created_at":"2024-11-12T18:05:52.962Z","updated_at":"2025-07-25T21:33:41.404Z","avatar_url":"https://github.com/zakarialaoui10.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Demo           \n[Want to try !](https://replit.com/@zakariaelalaoui/dir2tree#generated.json) \n## Install ![npm](https://img.shields.io/npm/v/dir2tree)\n```bash \nnpm install dir2tree\n```\n## Import\n### Common Js\n```js\nconst dir2tree=require(\"dir2tree\")\n```\n### Es Module\n```js\nimport dir2tree from dir2tree\n```\n## Syntaxe\n### Initialise\n```js\nconst MyTree=dir2tree(ROOT,OPTIONS,CALLBACKS)\nMyTree.write(Target,\"generated_file.json\")\n```\n#### Arguments\n- **`ROOT`** : The path to the root directory that we want handle. it's ***`required`***\n- **`OPTIONS`** : An object containing various configuration options to control the behavior of the tree generation.it's ***`optional`*** , These options might include :\n  - **`fileContent`** : (***Boolean***)\n  - **`fileName`** : (***Boolean***)\n  - **`fileExtension`** : (***Boolean***)\n  - **`length`** : (***Boolean***)\n  - **`size`** : (***Boolean***)\n  - **`linesCount`** : (***Boolean***)\n  - **`created`** : (***Boolean***)\n  - **`lastModified`** : (***Boolean***)\n  - **`skip`** :\n    - **`folder`** : (***String[]***)\n    - **`file`** : (***String[]***)\n    - **`extension`** : (***String[]***)\n  - **`sortBy`** : (***String***) , possible values : `\"names\"`,`\"extension\"`,`\"size\"`,`\"lines\"`,`\"created\"`,`\"lastmodified\"`,\n  - **`order`** : (***Number***)\n- **`CALLBACKS`** : it's ***`optional`***\n### Methodes\n- **`.write(Target, filename)`**\n- **`.flat(depth, separator)`**\n### Use It in your Github Repository\nCreate a workflow file like the one below.\n.github/workflow/dir2tree.yml\n```yml\nname: Generate Directory Tree using zakarialaoui10/dir2tree\non:\n  push: \n    branches:\n      - main\njobs:\n  build:\n    permissions :\n      contents : write\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout code\n        uses: actions/checkout@v2\n        with:\n          ref: ${{ github.head_ref }}\n      - name: Generate Directory Tree\n        uses: zakarialaoui10/dir2tree@main\n      - name: Commit \u0026 Push\n        run: |\n          git config user.name github-actions\n          git config user.email github-actions@github.com\n          git add -A .\n          git commit -m \"generated by zakarialaoui10/dir2tree\"\n          git push\n        env:\n          CUSTOM_TOKEN: ${{ secrets.CUSTOM_TOKEN }}\n```\n## License \nThis projet is licensed under the terms of MIT License .\u003cbr\u003e\n\u003cimg src=\"https://img.shields.io/github/license/zakarialaoui10/zikojs?color=rgb%2820%2C21%2C169%29\"\u003e\n\n\u003c!-- jsdoc --\u003e \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzakarialaoui10%2Fdir2tree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzakarialaoui10%2Fdir2tree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzakarialaoui10%2Fdir2tree/lists"}