UNPKG

621 BMarkdownView Raw
1# fstream-ignore
2
3A fstream DirReader that filters out files that match globs in `.ignore`
4files throughout the tree, like how git ignores files based on a
5`.gitignore` file.
6
7Here's an example:
8
9```javascript
10var Ignore = require("fstream-ignore")
11Ignore({ path: __dirname
12 , ignoreFiles: [".ignore", ".gitignore"]
13 })
14 .on("child", function (c) {
15 console.error(c.path.substr(c.root.path.length + 1))
16 })
17 .pipe(tar.Pack())
18 .pipe(fs.createWriteStream("foo.tar"))
19```
20
21This will tar up the files in __dirname into `foo.tar`, ignoring
22anything matched by the globs in any .iginore or .gitignore file.