![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
ghreleases
Advanced tools
Interact with the GitHub releases 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:
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.
release
parameter accepts either a release id
, 'latest'
or a valid ref, e.g. 'tags/v1.0.0'
files
parameter is an array of absolute file paths that should be uploaded and associated with this releaseconst 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
For interacting with other parts of the GitHub API, check out the modules below.
MIT
FAQs
Interact with the GitHub releases API
We found that ghreleases demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.