{"id":20157233,"url":"https://github.com/whyboris/flatten-this-folder","last_synced_at":"2026-02-12T20:31:51.546Z","repository":{"id":259299835,"uuid":"877575003","full_name":"whyboris/flatten-this-folder","owner":"whyboris","description":"CLI to flatten the folder by moving all files to current directory","archived":false,"fork":false,"pushed_at":"2024-11-10T16:12:53.000Z","size":9,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-28T07:51:38.717Z","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/whyboris.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":"2024-10-23T22:20:28.000Z","updated_at":"2025-09-22T01:22:08.000Z","dependencies_parsed_at":"2024-10-24T07:15:26.805Z","dependency_job_id":"1d6c5c32-acd1-437f-aadf-af0dd21286f0","html_url":"https://github.com/whyboris/flatten-this-folder","commit_stats":null,"previous_names":["whyboris/flatten-this-folder"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/whyboris/flatten-this-folder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whyboris%2Fflatten-this-folder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whyboris%2Fflatten-this-folder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whyboris%2Fflatten-this-folder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whyboris%2Fflatten-this-folder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/whyboris","download_url":"https://codeload.github.com/whyboris/flatten-this-folder/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whyboris%2Fflatten-this-folder/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29380604,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T19:05:20.189Z","status":"ssl_error","status_checked_at":"2026-02-12T19:01:44.216Z","response_time":55,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-11-13T23:44:43.048Z","updated_at":"2026-02-12T20:31:51.531Z","avatar_url":"https://github.com/whyboris.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm version](https://badge.fury.io/js/flatten-this-folder.svg)](http://badge.fury.io/js/flatten-this-folder)\n\n# Flatten This Folder\n\n`flatten` is a _CLI_ (command-line interface) that will flatten your folder structure in whatever folder you run it in. All the files in all the sub-folders will be moved to the current directory. No folders are deleted or moved.\n\nIf a filename collision happens, the CLI will append the filename with a dash and a number (e.g. `-1`, `-2`, ... `-69`). If any error happens, it will be logged and the corresponding file will not be moved.\n\n## Install\n\n`npm install -g flatten-this-folder`\n\n## Use\n\nIn your _terminal_ run `flatten`, this will flatten the current folder `.`\n\nRunning `flatten abc` will flatten the folder `abc` inside the current working directory in your _terminal_.\n\n## Catastrophe prevention\n\nAny time there are more than 10 files being moved, the _CLI_ will notify you of the total number and will require you type in \"yes\" before it will move files.\n\n⚠ **WARNING** ⚠ - running `flatten` in any _system directory_ (and then typing in \"yes\" for the _CLI_ to do its work) is _dangerous_ since there is no \"undo\" after files move (can break your computer).\n\n## Developing\n\nEdit the `move.js` file and run `npm start` to see your script working\n\n- `npm start` will run the command against the _playground_ folder\n- `npm run test` will test that the renamed file list matches the expected outcome\n- `npm run reset` will reset the _playground_ folder to its original form\n- `npm run check` will perform the above three tasks one after another:\n  1. flatten the _playground_ folder\n  2. run the test\n  3. reset the _playground_ folder to its initial state\n- `npm run global` will install the `flatten` _CLI_ / terminal command for you to use\n\n## Todo\n\n- [ ] if argv[2] `.startsWith('.')` filter for the file (e.g. `flatten .mp4` only moves _.mp4_ files)\n- [ ] if argv[2] `.equals('dry')` only console log everything\n- [ ] unit test to check file contents too\n- [ ] check what happens when filename length is at the OS limit\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhyboris%2Fflatten-this-folder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwhyboris%2Fflatten-this-folder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhyboris%2Fflatten-this-folder/lists"}