https://github.com/npm/fstream-ignore
https://github.com/npm/fstream-ignore
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/npm/fstream-ignore
- Owner: npm
- License: isc
- Archived: true
- Created: 2012-03-22T05:32:43.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2016-05-17T20:48:18.000Z (about 10 years ago)
- Last Synced: 2024-10-01T16:06:33.880Z (almost 2 years ago)
- Language: JavaScript
- Homepage:
- Size: 43.9 KB
- Stars: 37
- Watchers: 34
- Forks: 14
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fstream-ignore
A fstream DirReader that filters out files that match globs in `.ignore`
files throughout the tree, like how git ignores files based on a
`.gitignore` file.
Here's an example:
```javascript
var Ignore = require("fstream-ignore")
Ignore({ path: __dirname
, ignoreFiles: [".ignore", ".gitignore"]
})
.on("child", function (c) {
console.error(c.path.substr(c.root.path.length + 1))
})
.pipe(tar.Pack())
.pipe(fs.createWriteStream("foo.tar"))
```
This will tar up the files in __dirname into `foo.tar`, ignoring
anything matched by the globs in any .iginore or .gitignore file.