2.0.1 • Published 1 year ago

default-branch v2.0.1

Weekly downloads
243
License
MIT
Repository
github
Last release
1 year ago

default-branch

Get the default branch of a GitHub repository

Installation

npm install default-branch

Usage

import defaultBranch from 'default-branch';

console.log(await defaultBranch('knutkirkhorn/emorjis'));
// => main

console.log(await defaultBranch('https://github.com/knutkirkhorn/btc-value-cli'));
// => main

console.log(await defaultBranch('https://enterprise.github.corp/org/repo'));
// => default

API

defaultBranch(path)

Returns the default branch of a repository. The path can be username/repo-name, or a full url to the repository (example: https://github.com/knutkirkhorn/btc-value-cli).

Related

2.0.1

1 year ago

2.0.0

1 year ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago