# git-repo-name [![NPM version](https://img.shields.io/npm/v/git-repo-name.svg?style=flat)](https://www.npmjs.com/package/git-repo-name) [![NPM downloads](https://img.shields.io/npm/dm/git-repo-name.svg?style=flat)](https://npmjs.org/package/git-repo-name) [![Build Status](https://img.shields.io/travis/jonschlinkert/git-repo-name.svg?style=flat)](https://travis-ci.org/jonschlinkert/git-repo-name) Get the repository name from the git remote origin URL. ## Install Install with [npm](https://www.npmjs.com/): ```sh $ npm install git-repo-name --save ``` ## Usage ```js var repoName = require('git-repo-name'); ``` By default `process.cwd()` is used, but you can alternatively specify a different directory as the first argument. **async** ```js repoName(function(err, name) { //=> 'git-repo-name' }); ``` **sync** ```js repoName.sync(); //=> 'git-repo-name' ``` ## cwd Optionally specify the directory to use. **async** ```js repoName('foo', function(err, name) { //=> 'repo-foo-name' }); ``` **sync** ```js repoName.sync('foo'); //=> 'repo-foo-name' ``` ## Related projects You might also be interested in these projects: * [git-user-email](https://www.npmjs.com/package/git-user-email): Get the email address of the current user from git config. | [homepage](https://github.com/jonschlinkert/git-user-email) * [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) ## Contributing Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/git-repo-name/issues/new). ## Building docs Generate readme and API documentation with [verb](https://github.com/verbose/verb): ```sh $ npm install verb && npm run docs ``` Or, if [verb](https://github.com/verbose/verb) is installed globally: ```sh $ verb ``` ## Running tests Install dev dependencies: ```sh $ npm install -d && npm test ``` ## Author **Jon Schlinkert** * [github/jonschlinkert](https://github.com/jonschlinkert) * [twitter/jonschlinkert](http://twitter.com/jonschlinkert) ## License Copyright © 2016, [Jon Schlinkert](http://github.com/jonschlinkert). Released under the [MIT license](https://github.com/jonschlinkert/git-repo-name/blob/master/LICENSE). *** _This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on May 03, 2016._