Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jonschlinkert/git-repo-name
Get the repository name from the git remote origin URL
https://github.com/jonschlinkert/git-repo-name
get git javascript jonschlinkert name node nodejs origin remote repo repository url
Last synced: 6 days ago
JSON representation
Get the repository name from the git remote origin URL
- Host: GitHub
- URL: https://github.com/jonschlinkert/git-repo-name
- Owner: jonschlinkert
- License: mit
- Created: 2014-04-04T16:44:00.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2023-07-28T00:32:23.000Z (over 1 year ago)
- Last Synced: 2024-10-30T01:38:22.700Z (8 days ago)
- Topics: get, git, javascript, jonschlinkert, name, node, nodejs, origin, remote, repo, repository, url
- Language: JavaScript
- Homepage: https://github.com/jonschlinkert
- Size: 25.4 KB
- Stars: 22
- Watchers: 4
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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._