Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gh-release-fetch

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gh-release-fetch - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

1

dist/index.d.ts

@@ -10,1 +10,2 @@ export interface Release {

export declare function fetchVersion(release: Release): Promise<void>;
export declare function updateAvailable(repository: string, currentVersion: string): Promise<boolean>;

@@ -14,2 +14,3 @@ "use strict";

const node_fetch_1 = require("node-fetch");
const semver_1 = require("semver");
function fetchLatest(release) {

@@ -29,2 +30,9 @@ return __awaiter(this, void 0, void 0, function* () {

exports.fetchVersion = fetchVersion;
function updateAvailable(repository, currentVersion) {
return __awaiter(this, void 0, void 0, function* () {
const latestVersion = yield resolveRelease(repository);
return semver_1.gt(latestVersion, currentVersion);
});
}
exports.updateAvailable = updateAvailable;
function resolveRelease(repository) {

@@ -31,0 +39,0 @@ return __awaiter(this, void 0, void 0, function* () {

6

package.json
{
"name": "gh-release-fetch",
"version": "1.0.1",
"version": "1.0.2",
"description": "A library to fetch release binaries from GitHub Releases",

@@ -24,6 +24,8 @@ "main": "dist/index.js",

"@types/node-fetch": "^2.1.6",
"@types/semver": "^5.5.0",
"download": "^7.1.0",
"mkdirp": "^0.5.1",
"node-fetch": "^2.3.0"
"node-fetch": "^2.3.0",
"semver": "^5.6.0"
}
}
import * as download from 'download';
import * as mkdirp from 'mkdirp';
import fetch from 'node-fetch';
import { gt } from 'semver';

@@ -23,2 +24,7 @@ export interface Release {

export async function updateAvailable(repository: string, currentVersion: string): Promise<boolean> {
const latestVersion = await resolveRelease(repository);
return gt(latestVersion, currentVersion);
}
async function resolveRelease(repository: string): Promise<string> {

@@ -25,0 +31,0 @@ const res = await fetch(`https://api.github.com/repos/${repository}/releases/latest`);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc