{"id":18932657,"url":"https://github.com/yougotwill/sortifiler-core","last_synced_at":"2025-08-03T19:35:00.358Z","repository":{"id":106186022,"uuid":"229578375","full_name":"yougotwill/sortifiler-core","owner":"yougotwill","description":"Get your files sorted.","archived":false,"fork":false,"pushed_at":"2020-05-11T06:09:11.000Z","size":44,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-31T20:28:29.121Z","etag":null,"topics":["files","filesystem","folders","productivity","sort","sorting"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yougotwill.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":"2019-12-22T14:14:36.000Z","updated_at":"2020-05-11T06:09:14.000Z","dependencies_parsed_at":"2023-06-16T01:30:23.152Z","dependency_job_id":null,"html_url":"https://github.com/yougotwill/sortifiler-core","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yougotwill%2Fsortifiler-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yougotwill%2Fsortifiler-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yougotwill%2Fsortifiler-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yougotwill%2Fsortifiler-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yougotwill","download_url":"https://codeload.github.com/yougotwill/sortifiler-core/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239931451,"owners_count":19720515,"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":["files","filesystem","folders","productivity","sort","sorting"],"created_at":"2024-11-08T11:50:04.679Z","updated_at":"2025-02-20T23:28:41.832Z","avatar_url":"https://github.com/yougotwill.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sortifiler\n\n\u003e Get your files sorted. 📚🗂\n\n## Description\nAn opinionated API to sort your files and folders easily.\n\n**Desktop app coming soon! 🚀**\n\nEveryday you look at your *Desktop/Downloads* folder and think, \"Damn I need to clean up this mess\". 🤦\n\nThat feeling is why this package now exists. 😆\n\nSortifiler classifies files and folders and moves them into *\\_Type* folders for easy access at the root of your chosen directory. 🗃\n\n## Installation\n\nTo add Sortifiler to your project use `npm install sortifiler`.\n\nIf you are looking to sort your files from the terminal check out [Sortifiler CLI](https://github.com/yougotwill/sortifiler-cli)!\n\n## Usage\n\n```js\nconst sortifiler = require('sortifiler');\n\nsortifiler.sortAll('~/Desktop');\n// sorts your Desktop into _Type folders\n```\n\n## API\n\n### sortAll(folderPath)\n\nSorts all files and folders in a given directory.\n\n#### folderPath\n\nType: `string`\n\nThe path to the directory to be sorted.\n\n### sortFiles(folderPath)\n\nSorts all files in a given directory.\n\n#### folderPath\n\nType: `string`\n\nThe path to the directory to be sorted.\n\n### sortFolders(folderPath)\n\nSorts all folders in a given directory.\n\n#### folderPath\n\nType: `string`\n\nThe path to the directory to be sorted.\n\n### config({ whitelist, rules })\n\nOverride the default configuration found in [config.js](src/config.js).\n\n#### whitelist\n\nType: `string[]`\n\nAn array of the files and folders  to be ignored.\n\n#### rules\n\nType: `object`\n\nAn object containing the rules used when sorting.\n\n## How does the sorting work?\n\nSorting works based on rules. An example of a rule would be\n```\n\"Folder Name\": [\"*.fileExtension\", \"*.fileExtension2\", \"*.fileExtension\"]\n```\n- By default Sortifiler uses various *_Type* folders as seen below.\n- Folders are classified using the best matching *_Type* folder based on the files within the folder (not recursive).\n- The default rules that come with Sortifiler are as follows:\n\n| _Type Folder | File Extensions                           |\n| :------------- | :--------------------------------------- |\n| _Books         | \"*.epub\", \"*.mobi\"                         |\n| _Documents     | \"*.pdf\", \"*.txt\", \"*.doc\", \"*.docx\", \"*.ppt\", \"*.pptx\", \"*.md\", \"*.json\", \"*.ods\", \"*.log\", \"*.xls\", \"*.xlsx\", \"*.ttf\" |\n| _Images        | \"*.png\", \"*.jpg\", \"*.jpeg\", \"*.gif\", \"*.xcf\", \"*.stl\", \"*.blend\", \"*.obj\", \"*.mtl\", \"*.3ds\", \"*.tga\", \"*.icns\" |\n| _Music         | \"*.mp3\", \"*.wav\", \"*.flac\", \"*.m4a\", \"*.ogg\", \"*.mid\", \"*.asd\", \"*.m3u\", \"*.pls\", \"*.alp\", \"*.asx\", \"*.bfxrsound\", \"*.m3u8\", \"*.als\", \"*.m4r\" |\n| _Programs      | \"*.dmg\", \"*.exe\", \"*.sh\", \"*.app\", \"*.pkg\", \"*.apk\", \"*.ipa\", \"*.gba\", \"*.gbc\" |\n| _Scripts       | \"*.py\", \"*.java\", \"*.class\", \"*.sh\", \"*.cs\", \"*.r\", \"*.itermcolors\", \"*.terminal\", \"*.theme\", \"*.gbaskin\", \"*.tmtheme\", \"*.resbackup\" |\n| _Torrents      | \"*.torrent\"                               |\n| _Videos        | \"*.mkv\", \"*.mp4\", \"*.mov\", \"*.mpeg\", \"*.webm\", \"*.srt\", \"*.avi\" |\n| _Web           | \"*.html\", \"*.css\", \"*.js\", \"*.htm\"           |\n| _Zipped        | \"*.zip\", \"*.rar\", \"*.7z\", \"*.tar.gz\", \"*.tar\", \"*.gz\", \"*.unitypackage\", \"*.prefab\", \"*.fbx\" |\n\n- **Note:** The default rules are constantly updated so please check [config.js](src/config.js) for the latest set of rules.\n\n## Settings\n\nSortifiler comes with the follow settings by default:\n**NOTE:** The top rules take priority. E.g. The rules for torrent files will take priority over images, music, and videos.\n\n```json\n{\n  \"whitelist\": [\".DS_Store\", \"Desktop.ini\", \".Spotlight-V100\", \".Trashes\"], // Files / Folders to ignore when sorting\n  \"rules\": { // The rules used when sorting files.\n    \"_Torrents\": [\"*.torrent\"],\n    \"_Images\": [\"*.png\", \"*.jpg\", \"*.jpeg\", \"*.gif\", \"*.xcf\", \"*.stl\", \"*.blend\", \"*.obj\", \"*.mtl\", \"*.3ds\", \"*.tga\", \"*.icns\", \"*.piskel\", \"*.heif\", \"*.svg\"],\n    \"_Music\": [\"*.mp3\", \"*.wav\", \"*.flac\", \"*.m4a\", \"*.ogg\", \"*.mid\", \"*.asd\", \"*.m3u\", \"*.pls\", \"*.alp\", \"*.asx\", \"*.bfxrsound\", \"*.m3u8\", \"*.als\", \"*.m4r\", \"*.opus\"],\n    \"_Videos\": [\"*.mkv\", \"*.mp4\", \"*.mov\", \"*.mpeg\", \"*.webm\", \"*.srt\", \"*.avi\"],\n    \"_Books\": [\"*.epub\", \"*.mobi\"],\n    \"_Scripts\": [\"*.py\", \"*.java\", \"*.class\", \"*.sh\", \"*.cs\", \"*.r\", \"*.itermcolors\", \"*.terminal\", \"*.theme\", \"*.gbaskin\", \"*.deltaskin\", \"*.tmtheme\", \"*.resbackup\", \"*.xccolortheme\", \"*.js\", \"*.cottheme\"],\n    \"_Web\": [\"*.html\", \"*.css\", \"*.js\", \"*.htm\"],\n    \"_Programs\": [\"*.dmg\", \"*.exe\", \"*.sh\", \"*.app\", \"*.pkg\", \"*.apk\", \"*.ipa\", \"*.gba\", \"*.gbc\", \"*.iso\", \"*.jar\", \"*.z64\"],\n    \"_Zipped\": [\"*.zip\", \"*.rar\", \"*.7z\", \"*.tar.gz\", \"*.tar\", \"*.gz\", \"*.unitypackage\", \"*.prefab\", \"*.fbx\"],\n    \"_Documents\": [\"*.pdf\", \"*.txt\", \"*.doc\", \"*.docx\", \"*.dotx\", \"*.ppt\", \"*.pptx\", \"*.md\", \"*.json\", \"*.ods\", \"*.log\", \"*.xls\", \"*.xlsx\", \"*.ttf\"]\n  }\n}\n```\n\nYou can override Sortifiler's settings in multiple ways:\n  - Project-level settings: Change the project's settings in this [config file](src/config.js).\n  - Function-level settings: You can pass an arbitrary settings object via the `config` function, these settings have the highest priority.\n\n## Development\n\n### Contributing\n\n1. Fork it\n2. Create your feature branch: `git checkout -b feature/my-new-feature`\n3. Commit your changes: `git commit -am 'Add some feature'`\n4. Push to the branch: `git push origin feature/my-new-feature`\n5. Submit a pull request\n\n### Requirements / Dependencies\n\n- npm\n\n## Version\n\n0.2.2\n\n## License\n\n[GNU GPLv3](LICENSE)\n\n## References\n\n- Structure for user configuration files inspired by [bump](https://github.com/fabiospampinato/bump)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyougotwill%2Fsortifiler-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyougotwill%2Fsortifiler-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyougotwill%2Fsortifiler-core/lists"}