dotgitignore
v2.1.0
Published
find the closest .gitignore file, parse it, and apply ignore rules
Downloads
3,332,816
Readme
dotgitignore
find the closest .gitignore file, parse it, and apply ignore rules.
Usage
Given the following .gitignore
:
.DS_Store
node_modules
coverage
.nyc_output
const dotgit = require('dotgitignore')()
dotgit.ignore('.DS_Store') // returns 'true'.
dotgit.ignore('README.md') // returns 'false'.
API
require('dotgitignore')([opts])
: return instance ofdotgitignore
, optionally configured withopts
:opts.cwd
: current working directory (defaults to process.cwd()).
dotgit.ignore(name)
: returnstrue
if pattern is ignored,false
otherwise.