0.3.0 • Published 5 years ago
@ndcb/fs-ignore v0.3.0
@ndcb/fs-ignore
File filters to ignore parts of the file system.
Installation
npm install @ndcb/fs-ignoreUsage
A file exclusion rule has type (file : File) => boolean and returns true if and only if file is excluded by it.
Use the compositeExclusionRule function to compose exclusion rules together, such that a file is excluded if and only if any of the rules excludes it.
Use the exclusionRuleAsFilter function to convert an exclusion rule into a filter for use when filtering over iterables.
Exclusion Rules
Use the gitignoreExclusionRule function to create an exclusion rule matching the contents of a .gitignore file.
Only files that are descendant from the .gitignore file's directory are considered for exclusion.
This uses the ignore package.