{"id":13412600,"url":"https://github.com/jamiebuilds/purposefile","last_synced_at":"2025-05-08T19:30:21.862Z","repository":{"id":66094960,"uuid":"184169307","full_name":"jamiebuilds/purposefile","owner":"jamiebuilds","description":"Make sure every file in your repo is exactly where it should be","archived":false,"fork":false,"pushed_at":"2020-07-16T23:51:31.000Z","size":1579,"stargazers_count":169,"open_issues_count":3,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-21T04:21:34.494Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jamiebuilds.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}},"created_at":"2019-04-30T01:25:18.000Z","updated_at":"2025-02-28T03:02:55.000Z","dependencies_parsed_at":"2023-03-13T03:16:39.379Z","dependency_job_id":null,"html_url":"https://github.com/jamiebuilds/purposefile","commit_stats":{"total_commits":17,"total_committers":1,"mean_commits":17.0,"dds":0.0,"last_synced_commit":"6c0c46f4b5a8c6a33b6c83146113eddba9dd604c"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamiebuilds%2Fpurposefile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamiebuilds%2Fpurposefile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamiebuilds%2Fpurposefile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamiebuilds%2Fpurposefile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamiebuilds","download_url":"https://codeload.github.com/jamiebuilds/purposefile/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253135161,"owners_count":21859577,"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-07-30T20:01:26.635Z","updated_at":"2025-05-08T19:30:21.830Z","avatar_url":"https://github.com/jamiebuilds.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# purposefile\n\n\u003e Make sure every file in your repo is exactly where it should be.\n\n![Example of running purposefile CLI](./.github/list.png)\n\n## Install\n\nFirst, [make sure node and npm are installed](https://nodejs.org/).\n\nThen if you have an existing `package.json` you can run:\n\n```sh\nnpm install --save-dev purposefile\nnpx purposefile\n```\n\nOr if you want to use it globally you can also just run:\n\n```sh\nnpx purposefile\n```\n\nIt's recommended that you save this to your [`package.json#scripts`](https://docs.npmjs.com/misc/scripts)\n\n```json\n{\n\t\"name\": \"my-package\",\n\t\"scripts\": {\n\t\t\"check-files\": \"purposefile\"\n\t}\n}\n```\n\n```sh\nnpm run check-files\n```\n\n## Usage\n\nFirst create a `.purposefile` in the root of your project like this:\n\n```properties\n.purposefile                 Configures purposefile\n.gitignore                   Configures git to ignore certain files\n.prettierrc                  Configures Prettier\n.prettierignore              Configures Prettier ignored files\npackage.json                 Configures npm and related tools\npackage-lock.json            Lock file for npm dependencies\ntsconfig.json                Configures TypeScript\nREADME.md                    Documentation for repo\nLICENSE                      License for package\n.git/**                      Internal git state \u0026 config\nnode_modules/**/*            Dependencies installed by npm\ntypings/*/*.d.ts             TypeScript library type definitions\nsrc/**/*.ts                  Source files\n!src/**/*.test.ts            Dont place test files within src/\ntest/**/*.test.ts            Test files\ndist/**/*.{js,d.ts}{,.map}   Built source files\n.github/*.png                Images for README\n```\n\n\u003e **Note:** Entries are matched in reverse order. Entries with no defined\n\u003e purpose or that start with a `!` act like negations to the globs above them.\n\nThen run:\n\n```sh\nnpx purposefile\n```\n\nIf all the files in the repo are known, you'll get:\n\n![Example output of purposefile when all files are known](./.github/no-bad-files.png)\n\nOr if there's any unknown files:\n\n![Example output of purposefile when there are unknown files](./.github/bad-files.png)\n\nIf you want to check the purpose of a file you can run:\n\n```sh\npurposefile path/to/file\n```\n\n![Example output of purposefile for a single file lookup](./.github/lookup.png)\n\nIf you want to check the purpose of many files at once you can also specify globs:\n\n```sh\npurposefile '**' --ignore '**/node_modules/**'\n```\n\n![Example output of purposefile for a glob](./.github/list.png)\n\n\u003e **Note:** You can specify multiple `--ignore` patterns to exclude files from being listed.\n\nIf you want to check `purposefile` before every commit, you can do so with [Husky](https://github.com/typicode/husky):\n\n```jsonc\n{\n\t\"husky\": {\n\t\t\"hooks\": {\n\t\t\t\"pre-commit\": \"purposefile\" // Or \"purposefile \u0026\u0026 lint-staged\" if you use `lint-staged`\n\t\t}\n\t}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamiebuilds%2Fpurposefile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamiebuilds%2Fpurposefile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamiebuilds%2Fpurposefile/lists"}