dotgitignore

find the closest .gitignore file, parse it, and apply ignore rules

ISC 6 个版本
安装
npm install dotgitignore
yarn add dotgitignore
pnpm add dotgitignore
bun add dotgitignore
README

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.
版本列表
2.1.0 2019-03-16
2.0.0 2018-12-12
1.0.3 2018-01-03
1.0.2 2018-01-03
1.0.1 2018-01-02
1.0.0 2018-01-02