0.0.1-rc.1 • Published 5 months ago
private-badges v0.0.1-rc.1
github-private-shield-endpoint-badge
This library uses github's octokit rest api, to fetch the repository package.json content. It will return package information as json to create a badge with shields.io via the endpoint badge.
Shields.io is limited to public repositories, so this lib will help with private repositories.
Usage
const { version, name } = await ghBadgeRequest(
token, // the github token to provide access to the packages
owner, // the owner name if the packages are inside an github organization
repo, // the repository name of the package
path // the path to the package.json
);
will return something like
{
"schemaVersion": 1,
"label": "@owner/reponame",
"message": "1.0.0",
"color": "blue"
}
You can use the response to generate a badge. For more information https://shields.io/badges/endpoint-badge