git-repo-name

Get the repository name from the git remote origin URL.

MIT 13 个版本
安装
npm install git-repo-name
yarn add git-repo-name
pnpm add git-repo-name
bun add git-repo-name
README

git-repo-name NPM version NPM downloads Build Status

Get the repository name from the git remote origin URL.

Install

Install with npm:

$ npm install git-repo-name --save

Usage

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

repoName(function(err, name) {
  //=> 'git-repo-name'
});

sync

repoName.sync();
//=> 'git-repo-name'

cwd

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:

Contributing

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

Building docs

Generate readme and API documentation with verb:

$ npm install verb && npm run docs

Or, if verb is installed globally:

$ verb

Running tests

Install dev dependencies:

$ npm install -d && npm test

Author

Jon Schlinkert

License

Copyright © 2016, Jon Schlinkert. Released under the MIT license.


This file was generated by verb, v0.9.0, on May 03, 2016.

版本列表
1.0.1 2018-11-22
1.0.0 2018-11-22
0.6.0 2016-05-03
0.5.1 2015-11-28
0.5.0 2015-11-04
0.4.1 2015-10-22
0.4.0 2015-10-20
0.3.1 2015-02-28
0.3.0 2015-02-28
0.2.0 2014-05-15
0.1.2 2014-04-04
0.1.1 2014-04-04
0.1.0 2014-04-04