Get the repository name from the git remote origin URL.
Install with npm:
$ npm install git-repo-name --savevar repoName = require('git-repo-name');By default process.cwd() is used, but you can alternatively specify a different directory as the first argument.
async
repoName(function(err, name) {
//=> 'git-repo-name'
});sync
repoName.sync();
//=> 'git-repo-name'Optionally specify the directory to use.
async
repoName('foo', function(err, name) {
//=> 'repo-foo-name'
});sync
repoName.sync('foo');
//=> 'repo-foo-name'You might also be interested in these projects:
- git-user-email: Get the email address of the current user from git config. | homepage
- git-username: Get the username from a git remote origin URL. | homepage
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Generate readme and API documentation with verb:
$ npm install verb && npm run docsOr, if verb is installed globally:
$ verbInstall dev dependencies:
$ npm install -d && npm testJon Schlinkert
Copyright © 2016, Jon Schlinkert. Released under the MIT license.
This file was generated by verb, v0.9.0, on May 03, 2016.