{"_id":"git-log-parser","_rev":"4129748","name":"git-log-parser","description":"git-log-parser","dist-tags":{"latest":"1.2.1"},"maintainers":[{"name":"bendrucker","email":"bvdrucker@gmail.com"}],"time":{"modified":"2026-03-01T18:30:42.000Z","created":"2014-11-23T20:58:35.030Z","1.2.1":"2024-07-01T15:13:23.372Z","1.2.0":"2015-11-05T15:53:00.609Z","1.1.0":"2015-07-08T13:30:56.256Z","1.0.0":"2014-11-23T20:58:35.030Z"},"users":{},"author":"","repository":{"type":"git","url":"git+https://github.com/bendrucker/git-log-parser.git"},"versions":{"1.2.1":{"name":"git-log-parser","version":"1.2.1","description":"git-log-parser","main":"./src","dependencies":{"argv-formatter":"~1.0.0","spawn-error-forwarder":"~1.0.0","split2":"~1.0.0","stream-combiner2":"~1.1.1","through2":"~2.0.0","traverse":"0.6.8"},"devDependencies":{"chai":"~1.10.0","mocha":"~2.0.1"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/bendrucker/git-log-parser.git"},"author":"","license":"MIT","bugs":{"url":"https://github.com/bendrucker/git-log-parser/issues"},"homepage":"https://github.com/bendrucker/git-log-parser","_id":"git-log-parser@1.2.1","gitHead":"328c352802ca76765529ea18a63573b41a3f007a","_nodeVersion":"20.12.0","_npmVersion":"10.5.0","dist":{"shasum":"44355787b37af7560dcc4ddc01cb53b5d139cc28","size":3165,"noattachment":false,"key":"/git-log-parser/-/git-log-parser-1.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/git-log-parser/download/git-log-parser-1.2.1.tgz"},"_npmUser":{"name":"bendrucker","email":"bvdrucker@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/git-log-parser_1.2.1_1719846803208_0.21310592763428726"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-07-01T15:13:23.372Z","publish_time":1719846803372,"_source_registry_name":"default","maintainers":[{"name":"bendrucker","email":"bvdrucker@gmail.com"}],"_cnpm_publish_time":1719846803372},"1.2.0":{"name":"git-log-parser","version":"1.2.0","description":"git-log-parser","main":"./src","dependencies":{"argv-formatter":"~1.0.0","spawn-error-forwarder":"~1.0.0","split2":"~1.0.0","stream-combiner2":"~1.1.1","through2":"~2.0.0","traverse":"~0.6.6"},"devDependencies":{"chai":"~1.10.0","mocha":"~2.0.1"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/bendrucker/git-log-parser.git"},"author":"","license":"MIT","bugs":{"url":"https://github.com/bendrucker/git-log-parser/issues"},"homepage":"https://github.com/bendrucker/git-log-parser","gitHead":"658efedb70a23bd1e351a62f90f0a1fa5269260a","_id":"git-log-parser@1.2.0","_shasum":"2e6a4c1b13fc00028207ba795a7ac31667b9fd4a","_from":".","_npmVersion":"3.3.6","_nodeVersion":"5.0.0","_npmUser":{"name":"bendrucker","email":"bvdrucker@gmail.com"},"dist":{"shasum":"2e6a4c1b13fc00028207ba795a7ac31667b9fd4a","size":3175,"noattachment":false,"key":"/git-log-parser/-/git-log-parser-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/git-log-parser/download/git-log-parser-1.2.0.tgz"},"maintainers":[{"name":"bendrucker","email":"bvdrucker@gmail.com"}],"directories":{},"publish_time":1446738780609,"_cnpm_publish_time":1446738780609,"_hasShrinkwrap":false},"1.1.0":{"name":"git-log-parser","version":"1.1.0","description":"git-log-parser","main":"./src","dependencies":{"argv-formatter":"~1.0.0","spawn-error-forwarder":"~1.0.0","split":"~0.3.1","stream-combiner":"~0.2.1","through2":"~0.6.3","traverse":"~0.6.6"},"devDependencies":{"chai":"~1.10.0","mocha":"~2.0.1"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/bendrucker/git-log-parser.git"},"author":"","license":"MIT","bugs":{"url":"https://github.com/bendrucker/git-log-parser/issues"},"homepage":"https://github.com/bendrucker/git-log-parser","gitHead":"b1248af97279a5c14d7bce3e6883cfc6e8e78c6c","_id":"git-log-parser@1.1.0","_shasum":"1e2d70e0caafce35f858f9aec0609261f9088fce","_from":".","_npmVersion":"2.11.3","_nodeVersion":"2.3.3","_npmUser":{"name":"bendrucker","email":"bvdrucker@gmail.com"},"dist":{"shasum":"1e2d70e0caafce35f858f9aec0609261f9088fce","size":3178,"noattachment":false,"key":"/git-log-parser/-/git-log-parser-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/git-log-parser/download/git-log-parser-1.1.0.tgz"},"maintainers":[{"name":"bendrucker","email":"bvdrucker@gmail.com"}],"directories":{},"publish_time":1436362256256,"_cnpm_publish_time":1436362256256,"_hasShrinkwrap":false},"1.0.0":{"name":"git-log-parser","version":"1.0.0","description":"git-log-parser","main":"./src","dependencies":{"argv-formatter":"~1.0.0","spawn-error-forwarder":"~1.0.0","split":"~0.3.1","stream-combiner":"~0.2.1","through2":"~0.6.3","traverse":"~0.6.6"},"devDependencies":{"chai":"~1.10.0","mocha":"~2.0.1"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"https://github.com/bendrucker/git-log-parser.git"},"author":"","license":"MIT","bugs":{"url":"https://github.com/bendrucker/git-log-parser/issues"},"homepage":"https://github.com/bendrucker/git-log-parser","gitHead":"d133cba9bd45e72144d60a65940e8310c66e4aa2","_id":"git-log-parser@1.0.0","_shasum":"10f6e0461a1ddf74893cebcd08900e3324fa9bb0","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"bendrucker","email":"bvdrucker@gmail.com"},"maintainers":[{"name":"bendrucker","email":"bvdrucker@gmail.com"}],"dist":{"shasum":"10f6e0461a1ddf74893cebcd08900e3324fa9bb0","size":3024,"noattachment":false,"key":"/git-log-parser/-/git-log-parser-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/git-log-parser/download/git-log-parser-1.0.0.tgz"},"directories":{},"publish_time":1416776315030,"_cnpm_publish_time":1416776315030,"_hasShrinkwrap":false}},"readme":"git-log-parser [![Build Status](https://travis-ci.org/bendrucker/git-log-parser.svg?branch=master)](https://travis-ci.org/bendrucker/git-log-parser)\n==============\n\nRun `git log` and return a stream of commit objects.\n\n## Setup\n\n```bash\n$ npm install git-log-parser\n```\n\n## API\n\n#### `log.parse(config, options)` -> `Stream(commits)`\n\nAccepts a `config` object mapping to the [options accepted by `git log`](http://git-scm.com/docs/git-log). `config` will be automatically converted to command line options and flags by [argv-formatter](https://github.com/bendrucker/argv-formatter). Returns a stream of commit objects. \n\n`options` is passed directly to [`child_process.spawn`](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options).\n\nA commit is structured as follows:\n\n```js\n{\n  commit: {\n    'long': '4bba6092ecb2571301ca0daa2c55336ea2c74ea2',\n    'short': '4bba609'\n  },\n  tree: {\n    'long': 'b4ef3379e639f8c0034831deae8f6ce63dd41566',\n    'short': 'b4ef337'\n  },\n  author: {\n    'name': 'Ben Drucker',\n    'email': 'bvdrucker@gmail.com',\n    'date': new Date('2014-11-20T14:39:01.000Z')\n  },\n  committer: {\n    'name': 'Ben Drucker',\n    'email': 'bvdrucker@gmail.com',\n    'date': new Date('2014-11-20T14:39:01.000Z')\n  },\n  subject: 'Initial commit',\n  body: 'The commit body'\n}\n```\n\n`author.date` and `commiter.date` are `Date` objects while all other values are strings.\n\nIf you just want an array of commits, use [stream-to-array](https://www.npmjs.com/package/stream-to-array) to wrap the returned stream.\n\n#### `log.fields` -> `Object`\n\nCommit objects contain the most frequently used commit information. However, the [field mappings](https://github.com/bendrucker/git-log-parser/blob/master/src/fields.js) used to format and then parse log output can be amended before calling the parser. Consult the [full range of formatting placeholders](http://opensource.apple.com/source/Git/Git-19/src/git-htmldocs/pretty-formats.txt) and add the placeholder to the object tree if you wish to add extra fields.\n\n## Example\n\nGet all commits from earlier than an hour ago and stream them to `stdout` as pretty-printed JSON\n\n```js\nvar log      = require('git-log-parser');\nvar through2 = require('through2');\n\nlog.parse({\n  before: new Date(Date.now() - 60 * 60 * 1000)\n})\n.pipe(through2.obj(function (chunk, enc, callback) {\n  callback(null, JSON.stringify(chunk, undefined, 2));\n}))\n.pipe(process.stdout);\n```\n\nNote that `before` is stringified and passed directly as an argument to `git log`. No special handling is required for any standard `git log` option. You can filter by committer, time, or any other field supported by [`git log`](http://git-scm.com/docs/git-log).\n","_attachments":{},"homepage":"https://github.com/bendrucker/git-log-parser","bugs":{"url":"https://github.com/bendrucker/git-log-parser/issues"},"license":"MIT"}