{"id":16000620,"url":"https://github.com/jedwards1211/gitignore-fs","last_synced_at":"2025-08-08T16:08:48.408Z","repository":{"id":63341823,"uuid":"373715863","full_name":"jedwards1211/gitignore-fs","owner":"jedwards1211","description":"determine if any file is gitignored (complete Node.js implementation of gitignore rules)","archived":false,"fork":false,"pushed_at":"2023-10-15T15:35:36.000Z","size":745,"stargazers_count":4,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-25T14:25:23.182Z","etag":null,"topics":["git","gitignore"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/jedwards1211.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2021-06-04T04:04:43.000Z","updated_at":"2023-01-12T20:43:46.000Z","dependencies_parsed_at":"2024-06-20T19:15:14.330Z","dependency_job_id":null,"html_url":"https://github.com/jedwards1211/gitignore-fs","commit_stats":{"total_commits":41,"total_committers":1,"mean_commits":41.0,"dds":0.0,"last_synced_commit":"83d40bf4bf60ea232d7e46b8b9c5b4436ca4fb48"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/jedwards1211/gitignore-fs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedwards1211%2Fgitignore-fs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedwards1211%2Fgitignore-fs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedwards1211%2Fgitignore-fs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedwards1211%2Fgitignore-fs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jedwards1211","download_url":"https://codeload.github.com/jedwards1211/gitignore-fs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedwards1211%2Fgitignore-fs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269448992,"owners_count":24418995,"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","status":"online","status_checked_at":"2025-08-08T02:00:09.200Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["git","gitignore"],"created_at":"2024-10-08T09:05:04.732Z","updated_at":"2025-08-08T16:08:48.386Z","avatar_url":"https://github.com/jedwards1211.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gitignore-fs\n\n[![CircleCI](https://circleci.com/gh/jedwards1211/gitignore-fs.svg?style=svg)](https://circleci.com/gh/jedwards1211/gitignore-fs)\n[![Coverage Status](https://codecov.io/gh/jedwards1211/gitignore-fs/branch/master/graph/badge.svg)](https://codecov.io/gh/jedwards1211/gitignore-fs)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n[![npm version](https://badge.fury.io/js/gitignore-fs.svg)](https://badge.fury.io/js/gitignore-fs)\n\nIf you're using a library to ignore gitignored files, it probably doesn't do it right! Use this library to be match git behavior 100%.\n\nDetermine if any file is gitignored. This is intended to be a complete implementation of the gitignore spec, including `$GIT_DIR`, `$GIT_DIR/info/excludes`, and the `core.excludesFile` configuration variable.\n\n**Requires Node \u003e= 8.**\n\n# Getting started\n\n```\nnpm install --save gitignore-fs\n```\n\n```js\nconst Gitignore = require('gitignore-fs')\n\nconst gitignore = new Gitignore()\n\nconsole.log(gitignore.ignoresSync('node_modules')) // true or false depending on your config\n```\n\n# API\n\n## `class Gitignore`\n\nEach instance of this class keeps a separate cache of gitignore rules.\n\n### `new Gitignore([options])`\n\nCreates a new Gitignore instance.\n\n#### `options.initialRules` (`string[]`, _optional_)\n\nThese rules will be applied at lowest precedence (lower than rules from `core.excludesFile`).\nPaths with a slash in the beginning or middle are relative to the closest enclosing git directory.\n\n#### `options.finalRules` (`string[]`, _optional_)\n\nThese rules will be applied at highest precedence (higher than `.gitignore` files).\nPaths with a slash in the beginning or middle are relative to the closest enclosing git directory.\n\n### `.ignores(path)`\n\nDetermines if the given `path` is gitignored asynchronously.\n\n#### `path` (`string`, **required**)\n\nThe path to test. **Must end with / if it is a directory!**\n\n#### Returns (`Promise\u003cboolean\u003e`)\n\nA promise that will resolve to `true` if `path` is gitignored, `false` otherwise\n\n### `.ignoresSync(path)`\n\nDetermines if the given `path` is gitignored synchronously.\n\n#### `path` (`string`, **required**)\n\nThe path to test. **Must end with / if it is a directory!**\n\n#### Returns (`boolean`)\n\n`true` if `path` is gitignored, `false` otherwise\n\n### `.clearCache()`\n\nClears the entire gitignore rule cache.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjedwards1211%2Fgitignore-fs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjedwards1211%2Fgitignore-fs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjedwards1211%2Fgitignore-fs/lists"}