default-branch
Get the default branch of a GitHub repository
Installation
$ npm install default-branch
Usage
const defaultBranch = require('default-branch');
defaultBranch('Knutakir/emorjis').then(branch => {
console.log(branch);
});
defaultBranch('https://github.com/Knutakir/btc-value-cli').then(branch => {
console.log(branch);
});
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/Knutakir/btc-value-cli
).
Related
License
MIT © Knut Kirkhorn