{"id":15365483,"url":"https://github.com/tunnckocore/parse-git-log","last_synced_at":"2025-04-15T07:31:20.206Z","repository":{"id":31724216,"uuid":"35290098","full_name":"tunnckoCore/parse-git-log","owner":"tunnckoCore","description":"Parse a `git log` output of a repository into an object with useful commit data. Supports plugins, streaming, promises and callback APIs.","archived":false,"fork":false,"pushed_at":"2023-01-12T05:06:36.000Z","size":405,"stargazers_count":12,"open_issues_count":12,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T12:43:43.676Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://j.mp/1AL1Vst","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/tunnckoCore.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-08T16:35:18.000Z","updated_at":"2023-10-04T09:42:50.000Z","dependencies_parsed_at":"2023-01-14T19:38:46.878Z","dependency_job_id":null,"html_url":"https://github.com/tunnckoCore/parse-git-log","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tunnckoCore%2Fparse-git-log","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tunnckoCore%2Fparse-git-log/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tunnckoCore%2Fparse-git-log/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tunnckoCore%2Fparse-git-log/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tunnckoCore","download_url":"https://codeload.github.com/tunnckoCore/parse-git-log/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249026783,"owners_count":21200506,"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":[],"created_at":"2024-10-01T13:14:52.205Z","updated_at":"2025-04-15T07:31:19.874Z","avatar_url":"https://github.com/tunnckoCore.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# parse-git-log [![NPM version](https://img.shields.io/npm/v/parse-git-log.svg?style=flat)](https://www.npmjs.com/package/parse-git-log) [![NPM downloads](https://img.shields.io/npm/dm/parse-git-log.svg?style=flat)](https://npmjs.org/package/parse-git-log) [![npm total downloads][downloads-img]][downloads-url]\n\n\u003e Parse a `git log` output of a repository into an object with useful commit data. Supports plugins, streaming, promises and callback APIs.\n\n[![code climate][codeclimate-img]][codeclimate-url] \n[![standard code style][standard-img]][standard-url] \n[![linux build status][travis-img]][travis-url] \n[![windows build status][appveyor-img]][appveyor-url] \n[![coverage status][coveralls-img]][coveralls-url] \n[![dependency status][david-img]][david-url]\n\nYou might also be interested in [always-done](https://github.com/hybridables/always-done#readme).\n\n## Table of Contents\n- [Install](#install)\n- [Usage](#usage)\n- [API](#api)\n  * [parseGitLog](#parsegitlog)\n  * [.promise](#promise)\n- [Related](#related)\n- [Contributing](#contributing)\n- [Building docs](#building-docs)\n- [Running tests](#running-tests)\n- [Author](#author)\n- [License](#license)\n\n_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_\n\n## Install\nInstall with [npm](https://www.npmjs.com/)\n\n```\n$ npm install parse-git-log --save\n```\n\nor install using [yarn](https://yarnpkg.com)\n\n```\n$ yarn add parse-git-log\n```\n\n## Usage\n\u003e For more use-cases see the [tests](test.js)\n\n```js\nconst parseGitLog = require('parse-git-log')\n```\n\n## API\n\n### [parseGitLog](index.js#L63)\n\u003e Parses an advanced `git log` output using streams. Allows custom `plugin` function to be passed to update/modify the commit object (which is [vfile][]). It also emits `data` and `commit` events, so you may not need such `plugin` function. But in case you want to do some more parsing and interesting stuff, this `plugin` function allows you to do cool things. That `plugin` function is called with \"transform stream\" context and this is also passed as first argument. When you return a function from that plugin, it is called with [vfile][] object (commit object) as first argument.\n\n**Params**\n\n* `[cwd]` **{String}**: path to where is the `.git` folder; defaults to `process.cwd()`    \n* `[plugin]` **{Function}**: smart plugin function, passed with `stream, file` signature, if returns another function, that function is passed with `file` object which represent each commit object.    \n* `returns` **{Stream}**: transform stream, using [through2][] behind  \n\n**Events**\n* `emits`: `commit` passed with [vfile][] object for each commit  \n* `emits`: `data` same as `commit` event; passed with [vfile][] object for each commit  \n\n**Example**\n\n```js\nconst parseGitLog = require('parse-git-log')\n\n// optionally pass `cwd` as first argument\nparseGitLog()\n  .once('error', (err) =\u003e console.error('err:', err))\n  .on('commit', (commit) =\u003e console.log('commit:', commit))\n  .once('finish', () =\u003e console.log('done'))\n```\n\n### [.promise](index.js#L263)\n\u003e Thin Promise wrapper over the streaming API.\n\n**Params**\n\n* `[cwd]` **{String}**: path to where is the `.git` folder; defaults to `process.cwd()`    \n* `[plugin]` **{Function}**: smart plugin function, passed with `stream, file` signature, if returns another function, that function is passed with `file` object which represent each commit object.    \n* `returns` **{Promise}**: resolves array of [vfile][] commit objects, otherwise rejected promise  \n\n**Example**\n\n```js\nconst parseGitLog = require('parse-git-log')\n\nparseGitLog.promise('../foo-bar')\n  .then((commits) =\u003e {\n    console.log('list of commit objects:')\n    commits.forEach((commit) =\u003e console.log('commit:', commit))\n  })\n  .catch(console.error)\n```\n\n## Related\n- [always-done](https://www.npmjs.com/package/always-done): Handle completion and errors with elegance! Support for streams, callbacks, promises, child processes, async/await and sync functions. A drop-in replacement… [more](https://github.com/hybridables/always-done#readme) | [homepage](https://github.com/hybridables/always-done#readme \"Handle completion and errors with elegance! Support for streams, callbacks, promises, child processes, async/await and sync functions. A drop-in replacement for [async-done][] - pass 100% of its tests plus more\")\n- [each-promise](https://www.npmjs.com/package/each-promise): Iterate over promises, promise-returning or async/await functions in series or parallel. Support settle (fail-fast), concurrency (limiting) and hooks system (start… [more](https://github.com/tunnckocore/each-promise#readme) | [homepage](https://github.com/tunnckocore/each-promise#readme \"Iterate over promises, promise-returning or async/await functions in series or parallel. Support settle (fail-fast), concurrency (limiting) and hooks system (start, beforeEach, afterEach, finish)\")\n- [minibase](https://www.npmjs.com/package/minibase): Minimalist alternative for Base. Build complex APIs with small units called plugins. Works well with most of the already existing… [more](https://github.com/node-minibase/minibase#readme) | [homepage](https://github.com/node-minibase/minibase#readme \"Minimalist alternative for Base. Build complex APIs with small units called plugins. Works well with most of the already existing [base][] plugins.\")\n- [parse-function](https://www.npmjs.com/package/parse-function): Parse a function to an object that has its name, body, args and few more useful properties. Support regular functions… [more](https://github.com/tunnckocore/parse-function#readme) | [homepage](https://github.com/tunnckocore/parse-function#readme \"Parse a function to an object that has its name, body, args and few more useful properties. Support regular functions, async/await, arrow and generator functions.\")\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- [parse-semver](https://www.npmjs.com/package/parse-semver): Parse, normalize and validate given semver shorthand (e.g. gulp@v3.8.10) to object. | [homepage](https://github.com/tunnckocore/parse-semver#readme \"Parse, normalize and validate given semver shorthand (e.g. gulp@v3.8.10) to object.\")\n- [try-catch-core](https://www.npmjs.com/package/try-catch-core): Low-level package to handle completion and errors of sync or asynchronous functions, using [once][] and [dezalgo][] libs. Useful for and… [more](https://github.com/hybridables/try-catch-core#readme) | [homepage](https://github.com/hybridables/try-catch-core#readme \"Low-level package to handle completion and errors of sync or asynchronous functions, using [once][] and [dezalgo][] libs. Useful for and used in higher-level libs such as [always-done][] to handle completion of anything.\")\n\n## Contributing\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/tunnckoCore/parse-git-log/issues/new).  \nPlease read the [contributing guidelines](CONTRIBUTING.md) for advice on opening issues, pull requests, and coding standards.  \nIf you need some help and can spent some cash, feel free to [contact me at CodeMentor.io](https://www.codementor.io/tunnckocore?utm_source=github\u0026utm_medium=button\u0026utm_term=tunnckocore\u0026utm_campaign=github) too.\n\n**In short:** If you want to contribute to that project, please follow these things\n\n1. Please DO NOT edit [README.md](README.md), [CHANGELOG.md](CHANGELOG.md) and [.verb.md](.verb.md) files. See [\"Building docs\"](#building-docs) section.\n2. Ensure anything is okey by installing the dependencies and run the tests. See [\"Running tests\"](#running-tests) section.\n3. Always use `npm run commit` to commit changes instead of `git commit`, because it is interactive and user-friendly. It uses [commitizen][] behind the scenes, which follows Conventional Changelog idealogy.\n4. Do NOT bump the version in package.json. For that we use `npm run release`, which is [standard-version][] and follows Conventional Changelog idealogy.\n\nThanks a lot! :)\n\n## Building docs\nDocumentation and that readme is generated using [verb-generate-readme][], which is a [verb][] generator, so you need to install both of them and then run `verb` command like that\n\n```\n$ npm install verbose/verb#dev verb-generate-readme --global \u0026\u0026 verb\n```\n\n_Please don't edit the README directly. Any changes to the readme must be made in [.verb.md](.verb.md)._\n\n## Running tests\nClone repository and run the following in that cloned directory\n\n```\n$ npm install \u0026\u0026 npm test\n```\n\n## Author\n**Charlike Mike Reagent**\n\n+ [github/tunnckoCore](https://github.com/tunnckoCore)\n+ [twitter/tunnckoCore](http://twitter.com/tunnckoCore)\n+ [codementor/tunnckoCore](https://codementor.io/tunnckoCore)\n\n## License\nCopyright © 2016, [Charlike Mike Reagent](http://i.am.charlike.online). Released 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.2.0, on December 24, 2016._  \n_Project scaffolded using [charlike][] cli._\n\n[always-done]: https://github.com/hybridables/always-done\n[async-done]: https://github.com/gulpjs/async-done\n[base]: https://github.com/node-base/base\n[charlike]: https://github.com/tunnckocore/charlike\n[commitizen]: https://github.com/commitizen/cz-cli\n[dezalgo]: https://github.com/npm/dezalgo\n[once]: https://github.com/isaacs/once\n[standard-version]: https://github.com/conventional-changelog/standard-version\n[through2]: https://github.com/rvagg/through2\n[verb-generate-readme]: https://github.com/verbose/verb-generate-readme\n[verb]: https://github.com/verbose/verb\n[vfile]: https://github.com/wooorm/vfile\n\n[downloads-url]: https://www.npmjs.com/package/parse-git-log\n[downloads-img]: https://img.shields.io/npm/dt/parse-git-log.svg\n\n[codeclimate-url]: https://codeclimate.com/github/tunnckoCore/parse-git-log\n[codeclimate-img]: https://img.shields.io/codeclimate/github/tunnckoCore/parse-git-log.svg\n\n[travis-url]: https://travis-ci.org/tunnckoCore/parse-git-log\n[travis-img]: https://img.shields.io/travis/tunnckoCore/parse-git-log/master.svg?label=linux\n\n[appveyor-url]: https://ci.appveyor.com/project/tunnckoCore/parse-git-log\n[appveyor-img]: https://img.shields.io/appveyor/ci/tunnckoCore/parse-git-log/master.svg?label=windows\n\n[coveralls-url]: https://coveralls.io/r/tunnckoCore/parse-git-log\n[coveralls-img]: https://img.shields.io/coveralls/tunnckoCore/parse-git-log.svg\n\n[david-url]: https://david-dm.org/tunnckoCore/parse-git-log\n[david-img]: https://img.shields.io/david/tunnckoCore/parse-git-log.svg\n\n[standard-url]: https://github.com/feross/standard\n[standard-img]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftunnckocore%2Fparse-git-log","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftunnckocore%2Fparse-git-log","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftunnckocore%2Fparse-git-log/lists"}