{
  "_args": [
    [
      {
        "raw": "ignore@^3.3.3",
        "scope": null,
        "escapedName": "ignore",
        "name": "ignore",
        "rawSpec": "^3.3.3",
        "spec": ">=3.3.3 <4.0.0",
        "type": "range"
      },
      "/home/travis/build/lukesargeant/ember-sparkline/node_modules/eslint"
    ]
  ],
  "_from": "ignore@>=3.3.3 <4.0.0",
  "_id": "ignore@3.3.7",
  "_inCache": true,
  "_location": "/ignore",
  "_nodeVersion": "8.8.0",
  "_npmOperationalInternal": {
    "host": "s3://npm-registry-packages",
    "tmp": "tmp/ignore-3.3.7.tgz_1509026454121_0.4620765303261578"
  },
  "_npmUser": {
    "name": "kael",
    "email": "i@kael.me"
  },
  "_npmVersion": "5.4.2",
  "_phantomChildren": {},
  "_requested": {
    "raw": "ignore@^3.3.3",
    "scope": null,
    "escapedName": "ignore",
    "name": "ignore",
    "rawSpec": "^3.3.3",
    "spec": ">=3.3.3 <4.0.0",
    "type": "range"
  },
  "_requiredBy": [
    "/eslint"
  ],
  "_resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.7.tgz",
  "_shasum": "612289bfb3c220e186a58118618d5be8c1bab021",
  "_shrinkwrap": null,
  "_spec": "ignore@^3.3.3",
  "_where": "/home/travis/build/lukesargeant/ember-sparkline/node_modules/eslint",
  "author": {
    "name": "kael"
  },
  "bugs": {
    "url": "https://github.com/kaelzhang/node-ignore/issues"
  },
  "dependencies": {},
  "description": "Ignore is a manager and filter for .gitignore rules.",
  "devDependencies": {
    "babel-cli": "^6.26.0",
    "babel-preset-es2015": "^6.24.1",
    "chai": "~1.7.2",
    "codecov": "^1.0.1",
    "istanbul": "^0.4.5",
    "mkdirp": "^0.5.1",
    "mocha": "~1.13.0",
    "pre-suf": "^1.0.4",
    "rimraf": "^2.6.2",
    "spawn-sync": "^1.0.15",
    "tmp": "0.0.33"
  },
  "directories": {},
  "dist": {
    "integrity": "sha512-YGG3ejvBNHRqu0559EOxxNFihD0AjpvHlC/pdGKd3X3ofe+CoJkYazwNJYTNebqpPKN+VVQbh4ZFn1DivMNuHA==",
    "shasum": "612289bfb3c220e186a58118618d5be8c1bab021",
    "tarball": "https://registry.npmjs.org/ignore/-/ignore-3.3.7.tgz"
  },
  "files": [
    "ignore.js",
    "index.d.ts"
  ],
  "gitHead": "cc0395d925d477b022a153a656c5832eda4c9816",
  "homepage": "https://github.com/kaelzhang/node-ignore#readme",
  "keywords": [
    "ignore",
    ".gitignore",
    "gitignore",
    "npmignore",
    "rules",
    "manager",
    "filter",
    "regexp",
    "regex",
    "fnmatch",
    "glob",
    "asterisks",
    "regular-expression"
  ],
  "license": "MIT",
  "main": "./ignore.js",
  "maintainers": [
    {
      "name": "kael",
      "email": "i@kael.me"
    }
  ],
  "name": "ignore",
  "optionalDependencies": {},
  "readme": "<table><thead>\n  <tr>\n    <th>Linux</th>\n    <th>OS X</th>\n    <th>Windows</th>\n    <th>Coverage</th>\n    <th>Downloads</th>\n  </tr>\n</thead><tbody><tr>\n  <td colspan=\"2\" align=\"center\">\n    <a href=\"https://travis-ci.org/kaelzhang/node-ignore\">\n    <img\n      src=\"https://travis-ci.org/kaelzhang/node-ignore.svg?branch=master\"\n      alt=\"Build Status\" /></a>\n  </td>\n  <td align=\"center\">\n    <a href=\"https://ci.appveyor.com/project/kaelzhang/node-ignore\">\n    <img\n      src=\"https://ci.appveyor.com/api/projects/status/github/kaelzhang/node-ignore?branch=master&svg=true\"\n      alt=\"Windows Build Status\" /></a>\n  </td>\n  <td align=\"center\">\n    <a href=\"https://codecov.io/gh/kaelzhang/node-ignore\">\n    <img\n      src=\"https://codecov.io/gh/kaelzhang/node-ignore/branch/master/graph/badge.svg\"\n      alt=\"Coverage Status\" /></a>\n  </td>\n  <td align=\"center\">\n    <a href=\"https://www.npmjs.org/package/ignore\">\n    <img\n      src=\"http://img.shields.io/npm/dm/ignore.svg\"\n      alt=\"npm module downloads per month\" /></a>\n  </td>\n</tr></tbody></table>\n\n# ignore\n\n`ignore` is a manager, filter and parser which implemented in pure JavaScript according to the .gitignore [spec](http://git-scm.com/docs/gitignore).\n\nPay attention that [`minimatch`](https://www.npmjs.org/package/minimatch) does not work in the gitignore way. To filter filenames according to .gitignore file, I recommend this module.\n\n##### Tested on\n\n- Linux + Node: `0.8` - `7.x`\n- Windows + Node: `0.10` - `7.x`, node < `0.10` is not tested due to the lack of support of appveyor.\n\nActually, `ignore` does not rely on any versions of node specially.\n\n## Table Of Main Contents\n\n- [Usage](#usage)\n- [Guide for 2.x -> 3.x](#upgrade-2x---3x)\n- [Contributing](#contributing)\n- Related Packages\n  - [`glob-gitignore`](https://www.npmjs.com/package/glob-gitignore) matches files using patterns and filters them according to gitignore rules.\n\n## Usage\n\n```js\nconst ignore = require('ignore')\nconst ig = ignore().add(['.abc/*', '!.abc/d/'])\n```\n\n### Filter the given paths\n\n```js\nconst paths = [\n  '.abc/a.js',    // filtered out\n  '.abc/d/e.js'   // included\n]\n\nig.filter(paths)        // ['.abc/d/e.js']\nig.ignores('.abc/a.js') // true\n```\n\n### As the filter function\n\n```js\npaths.filter(ig.createFilter()); // ['.abc/d/e.js']\n```\n\n### Win32 paths will be handled\n\n```js\nig.filter(['.abc\\\\a.js', '.abc\\\\d\\\\e.js'])\n// if the code above runs on windows, the result will be\n// ['.abc\\\\d\\\\e.js']\n```\n\n## Why another ignore?\n\n- `ignore` is a standalone module, and is much simpler so that it could easy work with other programs, unlike [isaacs](https://npmjs.org/~isaacs)'s [fstream-ignore](https://npmjs.org/package/fstream-ignore) which must work with the modules of the fstream family.\n\n- `ignore` only contains utility methods to filter paths according to the specified ignore rules, so\n  - `ignore` never try to find out ignore rules by traversing directories or fetching from git configurations.\n  - `ignore` don't cares about sub-modules of git projects.\n\n- Exactly according to [gitignore man page](http://git-scm.com/docs/gitignore), fixes some known matching issues of fstream-ignore, such as:\n  - '`/*.js`' should only match '`a.js`', but not '`abc/a.js`'.\n  - '`**/foo`' should match '`foo`' anywhere.\n  - Prevent re-including a file if a parent directory of that file is excluded.\n  - Handle trailing whitespaces:\n    - `'a '`(one space) should not match `'a  '`(two spaces).\n    - `'a \\ '` matches `'a  '`\n  - All test cases are verified with the result of `git check-ignore`.\n\n## Methods\n\n### .add(pattern)\n### .add(patterns)\n\n- **pattern** `String|Ignore` An ignore pattern string, or the `Ignore` instance\n- **patterns** `Array.<pattern>` Array of ignore patterns.\n\nAdds a rule or several rules to the current manager.\n\nReturns `this`\n\nNotice that a line starting with `'#'`(hash) is treated as a comment. Put a backslash (`'\\'`) in front of the first hash for patterns that begin with a hash, if you want to ignore a file with a hash at the beginning of the filename.\n\n```js\nignore().add('#abc').ignores('#abc')    // false\nignore().add('\\#abc').ignores('#abc')   // true\n```\n\n`pattern` could either be a line of ignore pattern or a string of multiple ignore patterns, which means we could just `ignore().add()` the content of a ignore file:\n\n```js\nignore()\n.add(fs.readFileSync(filenameOfGitignore).toString())\n.filter(filenames)\n```\n\n`pattern` could also be an `ignore` instance, so that we could easily inherit the rules of another `Ignore` instance.\n\n### <strike>.addIgnoreFile(path)</strike>\n\nREMOVED in `3.x` for now.\n\nTo upgrade `ignore@2.x` up to `3.x`, use\n\n```js\nconst fs = require('fs')\n\nif (fs.existsSync(filename)) {\n  ignore().add(fs.readFileSync(filename).toString())\n}\n```\n\ninstead.\n\n\n### .ignores(pathname)\n\n> new in 3.2.0\n\nReturns `Boolean` whether `pathname` should be ignored.\n\n```js\nig.ignores('.abc/a.js')    // true\n```\n\n### .filter(paths)\n\nFilters the given array of pathnames, and returns the filtered array.\n\n- **paths** `Array.<path>` The array of `pathname`s to be filtered.\n\n**NOTICE** that:\n\n- `pathname` should be a string that have been `path.join()`ed, or the return value of `path.relative()` to the current directory.\n\n```js\n// WRONG\nig.ignores('./abc')\n\n// WRONG, for it will never happen.\n// If the gitignore rule locates at the root directory,\n// `'/abc'` should be changed to `'abc'`.\n// ```\n// path.relative('/', '/abc')  -> 'abc'\n// ```\nig.ignores('/abc')\n\n// Right\nig.ignores('abc')\n\n// Right\nig.ignores(path.join('./abc'))  // path.join('./abc') -> 'abc'\n```\n\n- In other words, each `pathname` here should be a relative path to the directory of the git ignore rules.\n\nSuppose the dir structure is:\n\n```\n/path/to/your/repo\n    |-- a\n    |   |-- a.js\n    |\n    |-- .b\n    |\n    |-- .c\n         |-- .DS_store\n```\n\nThen the `paths` might be like this:\n\n```js\n[\n  'a/a.js'\n  '.b',\n  '.c/.DS_store'\n]\n```\n\nUsually, you could use [`glob`](http://npmjs.org/package/glob) with `option.mark = true` to fetch the structure of the current directory:\n\n```js\nconst glob = require('glob')\n\nglob('**', {\n  // Adds a / character to directory matches.\n  mark: true\n}, (err, files) => {\n  if (err) {\n    return console.error(err)\n  }\n\n  let filtered = ignore().add(patterns).filter(files)\n  console.log(filtered)\n})\n```\n\n### .createFilter()\n\nCreates a filter function which could filter an array of paths with `Array.prototype.filter`.\n\nReturns `function(path)` the filter function.\n\n****\n\n## Upgrade 2.x -> 3.x\n\n- All `options` of 2.x are unnecessary and removed, so just remove them.\n- `ignore()` instance is no longer an [`EventEmitter`](nodejs.org/api/events.html), and all events are unnecessary and removed.\n- `.addIgnoreFile()` is removed, see the [.addIgnoreFile](#addignorefilepath) section for details.\n\n****\n\n## Contributing\n\nThe code of `node-ignore` is based on es6 and babel, but babel and its preset is not included in the `dependencies` field of package.json, so that the installation process of test cases will not fail in older versions of node.\n\nSo use `bash install.sh` to install dependencies and `bash test.sh` to run test cases in your local machine.\n\n#### Collaborators\n\n- [SamyPesse](https://github.com/SamyPesse) *Samy Pessé*\n- [azproduction](https://github.com/azproduction) *Mikhail Davydov*\n- [TrySound](https://github.com/TrySound) *Bogdan Chadkin*\n- [JanMattner](https://github.com/JanMattner) *Jan Mattner*\n",
  "readmeFilename": "README.md",
  "repository": {
    "type": "git",
    "url": "git+ssh://git@github.com/kaelzhang/node-ignore.git"
  },
  "scripts": {
    "build": "babel -o ignore.js index.js",
    "cov-report": "istanbul report",
    "prepublish": "npm run build",
    "test": "npm run build && istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec ./test/ignore.js && codecov",
    "test-no-cov": "npm run build && mocha --reporter spec ./test/ignore.js"
  },
  "version": "3.3.7"
}
