get-release

1.3.1 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i get-release

Weekly Downloads

6

Version

1.3.1

License

GPL-3.0

Unpacked Size

4.87 kB

Total Files

4

Last publish

Collaborators

  • khushrajrathod