{"id":17002316,"url":"https://github.com/smashah/ignorecheck","last_synced_at":"2025-04-12T06:24:58.252Z","repository":{"id":57271643,"uuid":"363741854","full_name":"smashah/ignorecheck","owner":"smashah","description":"A simple CLI/utility to ensure certain patterns are present in a project's .gitignore - Be sure to 🌟 this repository for updates! ","archived":false,"fork":false,"pushed_at":"2021-05-09T00:22:47.000Z","size":360,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-26T01:51:07.870Z","etag":null,"topics":["gitignore","gitignore-cli","security-tools"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smashah.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-02T20:17:46.000Z","updated_at":"2021-05-09T00:22:49.000Z","dependencies_parsed_at":"2022-08-25T06:51:13.719Z","dependency_job_id":null,"html_url":"https://github.com/smashah/ignorecheck","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smashah%2Fignorecheck","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smashah%2Fignorecheck/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smashah%2Fignorecheck/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smashah%2Fignorecheck/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smashah","download_url":"https://codeload.github.com/smashah/ignorecheck/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248526428,"owners_count":21118898,"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":["gitignore","gitignore-cli","security-tools"],"created_at":"2024-10-14T04:27:37.611Z","updated_at":"2025-04-12T06:24:58.226Z","avatar_url":"https://github.com/smashah.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/smashah/ignorecheck/master/assets/ignore-check.png\"/\u003e\n\n# ignore-check\n\n\u003e A simple CLI utility to make sure certain patterns are present in a project's .gitignore file.\n\u003e\n\n[![npm version](https://img.shields.io/npm/v/ignore-check.svg?color=green)](https://www.npmjs.com/package/ignore-check)\n[![Downloads](https://img.shields.io/npm/dm/ignore-check.svg)](https://www.npmjs.com/package/ignore-check)\n\n\u003c/div\u003e\n\n## Install\n\n```bash\n\u003e npm install --global ignore-check\n```\n\nor you can use npx to run it on the fly without installing it\n\n```bash\n\u003e npx ignore-check\n```\n\n## Usage\n\n```\n$ npx ignore-check\n\n  Usage\n    $ ignore-check -p \"**.data.json\" -p \"node_modules\"\n\n  Options\n    -p, --pattern=\u003cgitignore pattern entry\u003e (multiple) The patterns that need to present in the .gitignore\n    -d, --cwd=\u003cdirectory\u003e  Working directory, if not set, it will automatically try to find .gitignore files in parent directories recursively.\n    -c, --comment=\u003ccomment\u003e The comment you want surrounding the added lines.\n    -f, --force Forces the creationg of a .gitignore in the current directory if one does not   exist already or cannot be found while checking parent directories.\n    -s, --silent Silences all logs.\n    --dry-run Does not change any files, just outputs logs.\n```\n\n## For library maintainers\n\nIf you are developing a library that has specific sensitive file formats, you can add this script to your package.json as an `install` command.\n\nFor example, in [open-wa](https://github.com/open-wa/wa-automate-nodejs), there is a super sensitive file which always ends with `.data.json`.\n\nAs the maintainer, I want to make sure that these files never get commited to repos and end up being leaked publicly. So I've added the following line to my package.json for that library.\n\n```javascript\n//package.json\n{\n    ...\n    \"scripts\": {\n        ...\n        \"install\": \"npm_config_yes=true npx ignore-check -p \\\"**data.json\\\" -f --comment \\\"managed by open-wa\\\"\"\n        ...\n    }\n}\n```\n\nThis will now result in the ignore-check running every time someone installs or updates the library via `npm`.\n\nYour users can bypass this check by either:\n\n1. Running `npm install your-lib` with the `--ignore-scripts` flag. The disadvantage of doing this is that it will ignore scripts from other dependencies also.\n2. Set `SKIP_GITIGNORE_CHECK=true` as an environmental variable.\n\n## Acknowledgements \u0026 Inspirations\n\n- [ensure-gitignore](https://github.com/seek-oss/ensure-gitignore)\n- [find-up](https://github.com/sindresorhus/find-up)\n\n## License\n\nISC © [Mohammed Shah](https://github.com/smashah)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmashah%2Fignorecheck","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmashah%2Fignorecheck","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmashah%2Fignorecheck/lists"}