get-release
v1.3.1
Published
Provides a direct link for a released binary from Github / Bitbucket
Downloads
3
Readme
get-release
Provides a direct link for a released binary from Github / Bitbucket
Usage
JS
/**
* Options:
* {
* provider: (github | bitbucket),
* user: username,
* repo: repository,
* part: part of release file name - optional
* }
*
*/
const { getRelease, providerMethods } = require("get-release")
;(async _ => {
let url = await getRelease(
{
provider: "github",
user: "phhusson",
repo: "treble_experimentations",
part: "arm64-ab-gapps"
}
)
console.log(url[0])
})()
You can also declare custom providers or override existing providers. Provider names names must be ALL CAPITALS
const { getRelease, providerMethods } = require("get-release")
providerMethods.GITLAB = async ({user, repo, part = ""}) => {
// Custom code, should return a string
}
Returns:
- An array containing a link or multiple links
- An exception if the options are invalid or github's rate limit has been exceeded (if so try again in an hour)
Installation:
yarn add get-release
CLI
Usage: get-release (github|bitbucket) user repo [partofreleasefile]
Ex: get-release github phhusson treble_experimentations
get-release github phhusson treble_experimentations arm64-ab-gapps
get-release bitbucket JesusFreke smali
get-release bitbucket JesusFreke smali baksmali
Outputs the link itself if there is one match, otherwise outputs a JSON array
Installation:
yarn global add get-release