# glob-fs-gitignore [![NPM version](https://img.shields.io/npm/v/glob-fs-gitignore.svg?style=flat)](https://www.npmjs.com/package/glob-fs-gitignore) [![NPM monthly downloads](https://img.shields.io/npm/dm/glob-fs-gitignore.svg?style=flat)](https://npmjs.org/package/glob-fs-gitignore) [![NPM total downloads](https://img.shields.io/npm/dt/glob-fs-gitignore.svg?style=flat)](https://npmjs.org/package/glob-fs-gitignore) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/glob-fs-gitignore.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/glob-fs-gitignore)

> glob-fs middleware for automatically ignoring files specified in `.gitignore`

## Install

Install with [npm](https://www.npmjs.com/):

```sh
$ npm install --save glob-fs-gitignore
```

This is currently a built-in middleware with glob-fs, but it can also be used directly if the default middleware stack is disabled.

## Usage

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

Middleware is defined the same way with all readdir methods (e.g. `glob.readdir`, `glob.readdirSync`, `glob.readdirStream` and `glob.readdirPromise`):

```js
var glob = require('glob-fs')({ dotfiles: true })
  .use(gitignore()) // <= middleware
  .readdir('*', function (err, files) {
    console.log(files);
  });
```

## About

### Contributing

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).

### Contributors

| **Commits** | **Contributor** | 
| --- | --- |
| 12 | [jonschlinkert](https://github.com/jonschlinkert) |
| 1 | [StefanLiebenberg](https://github.com/StefanLiebenberg) |

### Building docs

_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_

To generate the readme, run the following command:

```sh
$ npm install -g verbose/verb#dev verb-generate-readme && verb
```

### Running tests

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

```sh
$ npm install && npm test
```

### Author

**Jon Schlinkert**

* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)

### License

Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT License](LICENSE).

***

_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 11, 2017._