{"id":15642436,"url":"https://github.com/jonschlinkert/parse-gitignore","last_synced_at":"2025-04-06T16:13:59.088Z","repository":{"id":27925719,"uuid":"31418006","full_name":"jonschlinkert/parse-gitignore","owner":"jonschlinkert","description":"Parse a gitignore file into an array of patterns. Comments and empty lines are stripped.","archived":false,"fork":false,"pushed_at":"2023-07-09T20:53:13.000Z","size":52,"stargazers_count":64,"open_issues_count":6,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-30T15:08:16.451Z","etag":null,"topics":["gitignore","glob","parse"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonschlinkert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/funding.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"jonschlinkert"}},"created_at":"2015-02-27T12:19:30.000Z","updated_at":"2024-12-22T08:19:05.000Z","dependencies_parsed_at":"2024-06-18T13:45:59.681Z","dependency_job_id":"9f35ac04-66c3-4103-a591-be38cf2445f5","html_url":"https://github.com/jonschlinkert/parse-gitignore","commit_stats":{"total_commits":41,"total_committers":6,"mean_commits":6.833333333333333,"dds":0.1707317073170732,"last_synced_commit":"caa44f75d7a66c80ea79fbc025a2a402d41ad1f4"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fparse-gitignore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fparse-gitignore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fparse-gitignore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fparse-gitignore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonschlinkert","download_url":"https://codeload.github.com/jonschlinkert/parse-gitignore/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247509237,"owners_count":20950232,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gitignore","glob","parse"],"created_at":"2024-10-03T11:56:13.076Z","updated_at":"2025-04-06T16:13:59.065Z","avatar_url":"https://github.com/jonschlinkert.png","language":"JavaScript","funding_links":["https://github.com/sponsors/jonschlinkert"],"categories":[],"sub_categories":[],"readme":"# parse-gitignore [![NPM version](https://img.shields.io/npm/v/parse-gitignore.svg?style=flat)](https://www.npmjs.com/package/parse-gitignore) [![NPM monthly downloads](https://img.shields.io/npm/dm/parse-gitignore.svg?style=flat)](https://npmjs.org/package/parse-gitignore) [![NPM total downloads](https://img.shields.io/npm/dt/parse-gitignore.svg?style=flat)](https://npmjs.org/package/parse-gitignore) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/parse-gitignore.svg?style=flat\u0026label=Travis)](https://travis-ci.org/jonschlinkert/parse-gitignore)\n\n\u003e Parse a .gitignore or .npmignore file into an array of patterns.\n\nPlease consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save parse-gitignore\n```\n\n## Heads up!\n\n### Breaking changes in v1.0!\n\nPrior to v1.0, this library also attempted to convert the returned patterns into valid globs.\n\nAs of v1.0, parse-gitignore was refactored and simplified down to less than ~50 sloc and no dependencies to provide a quick and easy way of getting the array of ignore patterns from a [.gitignore](#.gitignore) file. This allows you to do whatever you need to do with the patterns.\n\n## Usage\n\n```js\nconst fs = require('fs');\nconst parse = require('parse-gitignore');\n\n// pass the contents of a .gitignore file as a string or buffer\nconsole.log(parse(fs.readFileSync('foo/bar/.gitignore')));\n//=\u003e ['*.DS_Store', 'node_modules', ...];\n```\n\n## Example\n\nParses the contents of a `.gitignore` file, like the folowing:\n\n```sh\n# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n\n# Runtime data\npids\n*.pid\n*.seed\n*.pid.lock\n```\n\nInto an array, like the following:\n\n```js\n[ 'logs',\n  '*.log',\n  'npm-debug.log*',\n  'yarn-debug.log*',\n  'yarn-error.log*',\n  'pids',\n  '*.pid',\n  '*.seed',\n  '*.pid.lock' ]\n```\n\n## About\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eContributing\u003c/strong\u003e\u003c/summary\u003e\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eRunning Tests\u003c/strong\u003e\u003c/summary\u003e\n\nRunning 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:\n\n```sh\n$ npm install \u0026\u0026 npm test\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eBuilding docs\u003c/strong\u003e\u003c/summary\u003e\n\n_(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.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme \u0026\u0026 verb\n```\n\n\u003c/details\u003e\n\n### Related projects\n\nYou might also be interested in these projects:\n\n* [parse-author](https://www.npmjs.com/package/parse-author): Parse an author, contributor, maintainer or other 'person' string into an object with name, email… [more](https://github.com/jonschlinkert/parse-author) | [homepage](https://github.com/jonschlinkert/parse-author \"Parse an author, contributor, maintainer or other 'person' string into an object with name, email and url properties following npm conventions.\")\n* [parse-git-config](https://www.npmjs.com/package/parse-git-config): Parse `.git/config` into a JavaScript object. sync or async. | [homepage](https://github.com/jonschlinkert/parse-git-config \"Parse `.git/config` into a JavaScript object. sync or async.\")\n* [parse-github-url](https://www.npmjs.com/package/parse-github-url): Parse a github URL into an object. | [homepage](https://github.com/jonschlinkert/parse-github-url \"Parse a github URL into an object.\")\n\n### Contributors\n\n| **Commits** | **Contributor** |\n| --- | --- |\n| 33 | [jonschlinkert](https://github.com/jonschlinkert) |\n| 1 | [schnittstabil](https://github.com/schnittstabil) |\n| 1 | [RMacfarlane](https://github.com/RMacfarlane) |\n\n### Author\n\n**Jon Schlinkert**\n\n* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)\n* [GitHub Profile](https://github.com/jonschlinkert)\n* [Twitter Profile](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 26, 2018._\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Fparse-gitignore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonschlinkert%2Fparse-gitignore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Fparse-gitignore/lists"}