Get unlimited public & private packages + team-based management with npm Teams.Learn more »

dotgitignore

2.1.0 • Public • Published

dotgitignore

Build Status

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 of dotgitignore, optionally configured with opts:
    • opts.cwd: current working directory (defaults to process.cwd()).
  • dotgit.ignore(name): returns true if pattern is ignored, false otherwise.

Install

npm i dotgitignore

DownloadsWeekly Downloads

99,393

Version

2.1.0

License

ISC

Unpacked Size

6.62 kB

Total Files

8

Last publish

Collaborators

  • avatar