https://github.com/jonschlinkert/first-commit-date
Returns a JavaScript date object with the date and time of a git repository's first commit.
https://github.com/jonschlinkert/first-commit-date
commit first-commit git javascript nodejs
Last synced: 8 months ago
JSON representation
Returns a JavaScript date object with the date and time of a git repository's first commit.
- Host: GitHub
- URL: https://github.com/jonschlinkert/first-commit-date
- Owner: jonschlinkert
- License: mit
- Created: 2015-11-22T12:52:22.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-11-22T13:07:31.000Z (about 10 years ago)
- Last Synced: 2025-04-24T03:47:45.274Z (8 months ago)
- Topics: commit, first-commit, git, javascript, nodejs
- Language: JavaScript
- Size: 0 Bytes
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# first-commit-date [](http://badge.fury.io/js/first-commit-date) [](https://travis-ci.org/jonschlinkert/first-commit-date)
> Returns a JavaScript date object with the date and time of a git repository's first commit.
## Install
Install with [npm](https://www.npmjs.com/)
```sh
$ npm i first-commit-date --save
```
## Usage
```js
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**
```js
firstCommitDate('foo/.git', function(err, date) {
if (err) return console.log(err);
// do stuff with commit date
});
```
### [.sync](index.js#L55)
Synchronously get the first commit date from a git repository.
**Params**
* `cwd` **{String}**: current working directory
* `returns` **{Object}**
**Example**
```js
var date = firstCommitDate.sync('foo/.git');
```
## Related projects
* [git-repo-name](https://www.npmjs.com/package/git-repo-name): Get the repository name from the git remote origin URL. | [homepage](https://github.com/jonschlinkert/git-repo-name)
* [git-user-name](https://www.npmjs.com/package/git-user-name): Get a user's name from git config at the project or global scope, depending on… [more](https://www.npmjs.com/package/git-user-name) | [homepage](https://github.com/jonschlinkert/git-user-name)
* [git-username](https://www.npmjs.com/package/git-username): Get the username from a git remote origin URL. | [homepage](https://github.com/jonschlinkert/git-username)
* [github-base](https://www.npmjs.com/package/github-base): Base methods for creating node.js apps that work with the GitHub API. | [homepage](https://github.com/jonschlinkert/github-base)
## Running tests
Install dev dependencies:
```sh
$ npm i -d && npm test
```
## Contributing
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/first-commit-date/issues/new).
## Author
**Jon Schlinkert**
+ [github/jonschlinkert](https://github.com/jonschlinkert)
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
## License
Copyright © 2015 Jon Schlinkert
Released under the MIT license.
***
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on November 22, 2015._