A Node module to get the latest published full release for the Github repository.
const ghLatestRelease = require('gh-latest-release');
ghLatestRelease('strongloop/fsevents').then(release => console.log(release));
{
url: 'https://api.github.com/repos/strongloop/fsevents/releases/5506311',
assets_url: 'https://api.github.com/repos/strongloop/fsevents/releases/5506311/assets',
upload_url: 'https://uploads.github.com/repos/strongloop/fsevents/releases/5506311/assets{?name,label}',
html_url: 'https://github.com/strongloop/fsevents/releases/tag/v1.1.1',
id: 5506311,
tag_name: 'v1.1.1',
target_commitish: 'master',
name: '',
draft: false,
author: {
login: 'es128',
id: 1740641,
avatar_url: 'https://avatars.githubusercontent.com/u/1740641?v=3',
gravatar_id: '',
url: 'https://api.github.com/users/es128',
html_url: 'https://github.com/es128',
followers_url: 'https://api.github.com/users/es128/followers',
following_url: 'https://api.github.com/users/es128/following{/other_user}',
gists_url: 'https://api.github.com/users/es128/gists{/gist_id}',
starred_url: 'https://api.github.com/users/es128/starred{/owner}{/repo}',
subscriptions_url: 'https://api.github.com/users/es128/subscriptions',
organizations_url: 'https://api.github.com/users/es128/orgs',
repos_url: 'https://api.github.com/users/es128/repos',
events_url: 'https://api.github.com/users/es128/events{/privacy}',
received_events_url: 'https://api.github.com/users/es128/received_events',
type: 'User',
site_admin: false
},
prerelease: false,
created_at: '2017-02-20T05:14:55Z',
published_at: '2017-02-20T05:35:02Z',
assets: [],
tarball_url: 'https://api.github.com/repos/strongloop/fsevents/tarball/v1.1.1',
zipball_url: 'https://api.github.com/repos/strongloop/fsevents/zipball/v1.1.1',
body: 'Back to specifying compatibility with darwin platform only because some use cases rely upon it.\n'
}
npm install gh-latest-release
const ghLatestRelease = require('gh-latest-release');
ownerRepo: String
(/
-separated owner and repository names, for example https://github.com/es128/ssl-utils → 'es128/ssl-utils'
)
options: Object
(gh-get options)
Return: Promise<Object>
It makes an API request to get the latest release information, and returns a Promise
. The promise will be fulfilled with an object if successful, otherwise rejected with an error.
Copyright (c) 2016 - 2017 Shinnosuke Watanabe
Licensed under the MIT License.