{"id":24835757,"url":"https://github.com/tobilg/fs2obj","last_synced_at":"2025-03-26T03:40:19.564Z","repository":{"id":30560555,"uuid":"34115382","full_name":"tobilg/fs2obj","owner":"tobilg","description":"A Node.js module which recurses through a folder structure and returns an object with all found files/folders below the start path.","archived":false,"fork":false,"pushed_at":"2022-11-30T11:33:19.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-22T21:08:43.470Z","etag":null,"topics":[],"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/tobilg.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}},"created_at":"2015-04-17T12:28:31.000Z","updated_at":"2022-11-30T11:33:23.000Z","dependencies_parsed_at":"2023-01-14T17:12:55.816Z","dependency_job_id":null,"html_url":"https://github.com/tobilg/fs2obj","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobilg%2Ffs2obj","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobilg%2Ffs2obj/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobilg%2Ffs2obj/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobilg%2Ffs2obj/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tobilg","download_url":"https://codeload.github.com/tobilg/fs2obj/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245366143,"owners_count":20603439,"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":"2025-01-31T04:51:39.945Z","updated_at":"2025-03-26T03:40:19.543Z","avatar_url":"https://github.com/tobilg.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fs2obj\n\n## Current status\n\n[![Build Status](https://secure.travis-ci.org/tobilg/fs2obj.png?branch=master)](http://travis-ci.org/tobilg/fs2obj)\n[![Dependency Status](https://david-dm.org/tobilg/fs2obj.png)](https://david-dm.org/tobilg/fs2obj)\n\n## Basic usage\n\n### fs2obj( path [, options] )\n\nTo all the files and folder from a start folder and any sub-folders:\n\n\tvar fs2obj = require('fs2obj');\n\tvar structure = fs2obj('/path/to/folder');\n\nResulting object will look like:\n\n```\n{\n    \"items\": [{\n        \"name\": \"file1.js\",\n        \"type\": \"file\",\n        \"size\": 0\n    }, {\n        \"name\": \"file2.conf\",\n        \"type\": \"file\",\n        \"size\": 0\n    }, {\n        \"name\": \"file3.txt\",\n        \"type\": \"file\",\n        \"size\": 15\n    }, {\n        \"items\": [{\n            \"name\": \"test1-file.txt\",\n            \"type\": \"file\",\n            \"size\": 0\n        }, {\n            \"items\": [{\n                \"name\": \"subtest-file1.txt\",\n                \"type\": \"file\",\n                \"size\": 0\n            }],\n            \"name\": \"subtest1\",\n            \"type\": \"folder\"\n        }],\n        \"name\": \"test1\",\n        \"type\": \"folder\"\n    }]\n}\n```\n\n## Advanced usage\n\nOptions can be passed to alter the behaviour.\n\n### filterFiles\n\nA regular expression for what files to include. First matching group defines the key used in returned object.\nDefaults to `/^(.+)\\.js(on)?$/` (i.e. include all `.js` and `.json` files)\n\n\t// Include all .js files except those starting with `_`\n\tfs2obj('/path/to/folder', { filterFiles: /^([^_].*)\\.js$/ });\n\n### filterFolders\n\nA regular expression for what folders to iterate into. First matching group defines the key used in returned object.\nDefaults to `/^([^\\.].*)$/` (i.e. process all folders except those beginning with `.`)\n\n\t// Process all folders except those starting with `.` or `_`\n\tfs2obj('/path/to/folder', { filterFolders: /^([^\\._].*)$/ });\n\n### includeBasePath\n\nA boolean value whether the base path (from the start folder) should be included or not.\n\n### includeRealPath\n\nA boolean value whether the real path should be included or not.\n\n## Tests\n\nUse `npm test` to run the tests.\n\n## Issues\n\nIf you discover a bug, please raise an issue on Github. https://github.com/tobilg/fs2obj/issues\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftobilg%2Ffs2obj","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftobilg%2Ffs2obj","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftobilg%2Ffs2obj/lists"}