{"name":"fast-ignore","repository":{"type":"git","url":"git+https://github.com/fabiospampinato/fast-ignore.git"},"description":"A fast parser and processor for .gitignore files.","license":"MIT","version":"2.0.0","type":"module","main":"dist/index.js","exports":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"benchmark":"tsex benchmark","benchmark:watch":"tsex benchmark --watch","benchmark:prepare":"cd tasks && git clone https://github.com/babel/babel.git","clean":"tsex clean","compile":"tsex compile","compile:watch":"tsex compile --watch","test":"node test/index.js","test:watch":"tsex test --watch","prepublishOnly":"npm run clean && npm run compile && npm run test"},"keywords":["fast","gitignore","dotignore","ignore"],"dependencies":{"grammex":"^3.1.12","string-escape-regex":"^1.0.1"},"devDependencies":{"benchloop":"^2.1.1","fava":"^0.3.5","tsex":"^4.0.2","typescript":"^5.9.3"},"gitHead":"9adbb13850501232c728fa2fd486da239c2ae596","_id":"fast-ignore@2.0.0","bugs":{"url":"https://github.com/fabiospampinato/fast-ignore/issues"},"homepage":"https://github.com/fabiospampinato/fast-ignore#readme","_nodeVersion":"24.11.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-41OOPBgTDyVjF2oytGXvmqm56a38znzWLTQhvD3gp3FPCs37+j7qYjWDnL2WEA0P/Z80W53MKAXNJxc0JT8Tpw==","shasum":"9b7386c69cef056c93fc8db02bb678cee91d2e4a","tarball":"http://registry-npm.ywwl.com/fast-ignore/download/fast-ignore-2.0.0.tgz","fileCount":23,"unpackedSize":17052,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCCbAx8KZwB7rqiG8V8Wo/Ru/PO93Uvp6+d/aIFBuvbxAIgZI5ihIve87A/C9xFuG8YXS1KycugtVFzOtqAuDzsKVk="}],"size":6050,"noattachment":false,"key":"/fast-ignore/-/fast-ignore-2.0.0.tgz"},"_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"directories":{},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/fast-ignore_2.0.0_1771183936818_0.7971073839765488"},"_hasShrinkwrap":false,"readme":"# Fast Ignore\n\nA fast parser and processor for `.gitignore` files.\n\n## Install\n\n```sh\nnpm install fast-ignore\n```\n\n## Usage\n\n```ts\nimport fastIgnore from 'fast-ignore';\n\n// Let's create the content of a .gitignore file\n\nconst gitignore = `\n# Some always-ignore files\n*~\n*.err\n*.log\n._*\n.cache\n.fseventsd\n.DocumentRevisions*\n.DS_Store\n.TemporaryItems\n.Trashes\nThumbs.db\n\n# Some project-specific ignores\ndist\nnode_modules\n\n# Some directory-only ignores\ndir/\n`;\n\n// Let's create our ignore function\n\nconst ignore = fastIgnore ( gitignore );\n\n// Now we can check if a relative path should be ignored\n\nignore ( 'foo/bar.js' ); // false\nignore ( 'node_modules/foo/bar.js' ); // true\nignore ( 'dist/foo/bar.js' ); // true\n\n// Directory-only globs are supported _automatically_ when the situation is unambiguous\n// In the following scenario we know for sure that \"dir\" must be a directory, so it's ignored\n\nignore ( 'dir/foo.js' ); // true\n\n// Directory-only globs are supported _manually_ when the situation is ambiguous\n// In the following scenario we can't know for sure if \"dir\" is a file or a directory\n// We are going to assume it's not a directory, but if it is then you need to tell the library via the options object\n\nignore ( 'dir' ); // false\nignore ( 'dir', { isDirectory: true } ); // true\n\n// We can also work with multiple ignore files at once, which is faster than handling them individually\n// This goes roughly as fast as just concatenating the files together, but with the semantics of separate files\n// The difference is that an ignore file that comes later won't be able to un-ignore something that was ignored by a previous one\n// As a result please note that writing `fastIgnore ([ 'dist', '!dist' ])` may work differently than you expected\n\nconst prettierignore = `\n**/test\n**/__test__\n\n# The following globs are effectively useless\n# because they can't un-ignore something that was ignored by any previous ignore files\n!dist\n!node_modules\n`;\n\nconst comboIgnore = fastIgnore ([ gitignore, prettierignore ]);\n\ncomboIgnore ( 'foo/bar.js' ); // false\ncomboIgnore ( 'node_modules/foo/bar.js' ); // true\ncomboIgnore ( 'dist/foo/bar.js' ); // true\ncomboIgnore ( 'test/foo/bar.js' ); // true\n```\n\n## License\n\nMIT © Fabio Spampinato\n","publish_time":1771183936948,"_cnpm_publish_time":1771183936948,"dist-tags":{"latest":"2.0.0"}}