# gitignore-parser

> A simple .gitignore parser.

Latest version **0.0.2** (published 2015-04-07) · 0 weekly downloads

## Install

```sh
npm install gitignore-parser
pnpm add gitignore-parser
yarn add gitignore-parser
bun add gitignore-parser
```

## Health

**Score 18/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2015-04-07 |
| First published | 2014-04-04 |
| Weekly downloads | 0 |
| TypeScript types | separate (@types/gitignore-parser) |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 98 |
| Author | Charles Pick |
| Maintainers | codemix |
| Keywords | gitignore, git, .gitignore, git ignore |

## Links

- npm: https://www.npmjs.com/package/gitignore-parser
- Repository: http://github.com/codemix/gitignore-parser
- Homepage: https://github.com/codemix/gitignore-parser
- Issues: https://github.com/codemix/gitignore-parser/issues
- npm.io page: https://npm.io/package/gitignore-parser

## Recent versions

- 0.0.2 (latest) — 2015-04-07
- 0.0.1 — 2014-04-04

## README

# Gitignore Parser

A very simple `.gitignore` parser for node.js.

[![Build Status](https://travis-ci.org/codemix/gitignore-parser.svg?branch=master)](https://travis-ci.org/codemix/gitignore-parser)


## Installation

`npm install gitignore-parser`


## Usage

```js
var parser = require('gitignore-parser'),
    fs = require('fs');

var gitignore = parser.compile(fs.readFileSync('.gitignore', 'utf8'));

gitignore.accepts('LICENSE.md') === true;
gitignore.denies('LICENSE.md') === false;

gitignore.accepts('node_modules/mocha/bin') === false;
gitignore.denies('node_modules/mocha/bin') === true;


var files = [
  '.gitignore',
  '.travis.yml',
  'LICENSE.md',
  'README.md',
  'package.json',
  'lib/index.js',
  'test/index.js',
  'test/mocha.opts',
  'node_modules/mocha/bin/mocha',
  'node_modules/mocha/README.md'
];

// only files that are not gitignored
files.filter(gitignore.accepts);

// only files that *are* gitignored
files.filter(gitignore.denies);

```


### License

Apache 2, see [LICENSE.md](./LICENSE.md).

---
_Source: https://npm.io/package/gitignore-parser · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
