Skip to content

Returns a JavaScript date object with the date and time of a git repository's first commit.

License

Notifications You must be signed in to change notification settings

jonschlinkert/first-commit-date

Repository files navigation

first-commit-date NPM version Build Status

Returns a JavaScript date object with the date and time of a git repository's first commit.

Install

Install with npm

$ npm i first-commit-date --save

Usage

var firstCommitDate = require('first-commit-date');

firstCommitDate(function(err, date) {
  if (err) return console.log(err);
  console.log('first commit!', date);
});
//=> first commit! Tue Nov 17 2015 13:29:18 GMT-0500 (EST)

API

Params

  • cwd {String}: current working directory
  • callback {Function}
  • returns {Object}

Example

firstCommitDate('foo/.git', function(err, date) {
  if (err) return console.log(err);
  // do stuff with commit date
});

Synchronously get the first commit date from a git repository.

Params

  • cwd {String}: current working directory
  • returns {Object}

Example

var date = firstCommitDate.sync('foo/.git');

Related projects

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Author

Jon Schlinkert

License

Copyright © 2015 Jon Schlinkert Released under the MIT license.


This file was generated by verb-cli on November 22, 2015.

About

Returns a JavaScript date object with the date and time of a git repository's first commit.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published