npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ghreleases

v3.0.2

Published

Interact with the GitHub releases API

Downloads

52,427

Readme

ghreleases

Interact with the GitHub releases API.

npm node travis david standard npm

API

list(auth, org, repo[, options], cb)

List all releases for a repo. Calls back with an array of releases.

const gh = require('ghreleases')
const auth = {
  token: '90230948aef88723eca2309880fea09789234',
  user: 'ralphtheninja'
}
gh.list(auth, 'level', 'leveldown', (err, list) => {
  console.log(list)
})

GitHub docs.

getLatest(auth, org, repo[, options], cb)

Get latest release.

gh.getLatest(auth, 'level', 'leveldown', (err, release) => {
  console.log(release)
})

GitHub docs.

getById(auth, org, repo, id[, options], cb)

Get data for a single release.

gh.getById(auth, 'level', 'leveldown', '1363866', (err, release) => {
  console.log(release)
})

GitHub docs.

getByTag(auth, org, repo, tag[, options], cb)

Get release by tag.

gh.getByTag(auth, 'level', 'leveldown', 'v1.2.2', (err, release) => {
  console.log(release)
})

GitHub docs.

create(auth, org, repo, data[, options], cb)

Create a release.

const data = {
  tag_name: '1.2.3-test',
  name: 'Release name for 1.2.3-test',
  body: 'Body text of release goes here'
}
gh.create(auth, 'level', 'leveldown', data, (err, release) => {
  console.log(release)
})

The release on GitHub would then look as follows:

1.2.3-test release

GitHub docs

uploadAssets(auth, org, repo, release, files[, options], cb)

Upload assets to a release. Calls back with an array of results for each upload request.

  • The release parameter accepts either a release id, 'latest' or a valid ref, e.g. 'tags/v1.0.0'
  • The files parameter is an array of absolute file paths that should be uploaded and associated with this release
const ref = 'tags/v1.3.0'
const files = [
  '/path/to/README.md',
  '/path/to/prebuilt/binary.tar.gz'
]
gh.uploadAssets(auth, 'level', 'leveldown', ref, files, (err, res) => {
  console.log(res)
})

GitHub docs

Also See

For interacting with other parts of the GitHub API, check out the modules below.

License

MIT