New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

get-latest-release

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-latest-release

Find the latest release of a given GitHub repository

latest
Source
npmnpm
Version
1.1.2
Version published
Maintainers
1
Created
Source

get-latest-release

Find the latest release of a given GitHub repository

Install

$ npm install --save get-latest-release

Usage

const getLatestRelease = require('get-latest-release');

getLatestRelease({
  owner: 'sindresorhus',
  repo: 'caprine',
  ext: 'dmg'
});
/**
{ 
  version: 'v2.3.1',
  url: 'https://github.com/sindresorhus/caprine/releases/tag/v2.3.1',
  asset: { 
    url: 'https://api.github.com/repos/sindresorhus/caprine/releases/assets/3867404',
    name: 'caprine-2.3.1.dmg',
    content_type: 'application/x-apple-diskimage',
    download_url: 'https://github.com/sindresorhus/caprine/releases/download/v2.3.1/caprine-2.3.1.dmg' 
  } 
}
*/

getLatestRelease({
  owner: 'sindresorhus',
  repo: 'caprine',
});
/**
{ 
  version: 'v2.3.1',
  url: 'https://github.com/sindresorhus/caprine/releases/tag/v2.3.1'
  assets: [ 
    { 
      url: 'https://api.github.com/repos/sindresorhus/caprine/releases/assets/3867410',
      name: 'caprine-2.3.1-mac.zip',
      content_type: 'application/zip',
      download_url: 'https://github.com/sindresorhus/caprine/releases/download/v2.3.1/caprine-2.3.1-mac.zip' 
    },
    { 
      url: 'https://api.github.com/repos/sindresorhus/caprine/releases/assets/3867402',
      name: 'caprine-2.3.1-x86_64.AppImage',
      content_type: 'application/octet-stream',
      download_url: 'https://github.com/sindresorhus/caprine/releases/download/v2.3.1/caprine-2.3.1-x86_64.AppImage' 
    },
    { 
      url: 'https://api.github.com/repos/sindresorhus/caprine/releases/assets/3867404',
      name: 'caprine-2.3.1.dmg',
      content_type: 'application/x-apple-diskimage',
      download_url: 'https://github.com/sindresorhus/caprine/releases/download/v2.3.1/caprine-2.3.1.dmg' 
    },
    { 
      url: 'https://api.github.com/repos/sindresorhus/caprine/releases/assets/3867415',
      name: 'caprine-setup-2.3.1.exe',
      content_type: 'application/x-msdownload',
      download_url: 'https://github.com/sindresorhus/caprine/releases/download/v2.3.1/caprine-setup-2.3.1.exe' 
    },
    { 
      url: 'https://api.github.com/repos/sindresorhus/caprine/releases/assets/3867409',
      name: 'caprine_2.3.1_amd64.deb',
      content_type: 'application/x-debian-package',
      download_url: 'https://github.com/sindresorhus/caprine/releases/download/v2.3.1/caprine_2.3.1_amd64.deb' 
    },
    { 
      url: 'https://api.github.com/repos/sindresorhus/caprine/releases/assets/3867411',
      name: 'latest-mac.json',
      content_type: 'application/json',
      download_url: 'https://github.com/sindresorhus/caprine/releases/download/v2.3.1/latest-mac.json' 
    },
    { 
      url: 'https://api.github.com/repos/sindresorhus/caprine/releases/assets/3867416',
      name: 'latest.yml',
      content_type: 'text/yaml',
      download_url: 'https://github.com/sindresorhus/caprine/releases/download/v2.3.1/latest.yml' 
    } 
  ]
}
*/

CLI

$ npm install --global get-latest-release
$ get-latest-release --help

  Find the latest release of a given GitHub repository

  Usage
    $ get-latest-release -o [owner] -r [repository]

  Options
    -o  Owner of the repository [required]
    -r  Respository to get latest released from [required]
    -e  Extension of a target release asset [optional]

  Examples
    $ get-latest-release -r caprine -o sindresorhus -e dmg
    The latest version is: v2.3.1
    Tag URL: https://github.com/sindresorhus/caprine/releases/tag/v2.3.1

    Asset name: caprine-2.3.1.dmg
    Asset URL: https://api.github.com/repos/sindresorhus/caprine/releases/assets/3867404
    Content Type: application/x-apple-diskimage
    Download URL: https://github.com/sindresorhus/caprine/releases/download/v2.3.1/caprine-2.3.1.dmg

License

MIT © jxom

Keywords

cli-app

FAQs

Package last updated on 28 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts