@electron/get
Advanced tools
Comparing version 1.14.1 to 2.0.0
@@ -1,2 +0,2 @@ | ||
import * as got from 'got'; | ||
import { Progress as GotProgress, Options as GotOptions } from 'got'; | ||
import { Downloader } from './Downloader'; | ||
@@ -6,7 +6,9 @@ /** | ||
*/ | ||
export declare type GotDownloaderOptions = got.GotOptions<string | null> & { | ||
export declare type GotDownloaderOptions = (GotOptions & { | ||
isStream?: true; | ||
}) & { | ||
/** | ||
* if defined, triggers every time `got`'s `downloadProgress` event callback is triggered. | ||
*/ | ||
getProgressCallback?: (progress: got.Progress) => Promise<void>; | ||
getProgressCallback?: (progress: GotProgress) => Promise<void>; | ||
/** | ||
@@ -13,0 +15,0 @@ * if `true`, disables the console progress bar (setting the `ELECTRON_GET_NO_PROGRESS` |
@@ -15,3 +15,3 @@ "use strict"; | ||
const fs = require("fs-extra"); | ||
const got = require("got"); | ||
const got_1 = require("got"); | ||
const path = require("path"); | ||
@@ -47,3 +47,3 @@ const ProgressBar = require("progress"); | ||
await new Promise((resolve, reject) => { | ||
const downloadStream = got.stream(url, gotOptions); | ||
const downloadStream = got_1.default.stream(url, gotOptions); | ||
downloadStream.on('downloadProgress', async (progress) => { | ||
@@ -59,4 +59,4 @@ progressPercent = progress.percent; | ||
downloadStream.on('error', error => { | ||
if (error.name === 'HTTPError' && error.statusCode === 404) { | ||
error.message += ` for ${error.url}`; | ||
if (error instanceof got_1.HTTPError && error.response.statusCode === 404) { | ||
error.message += ` for ${error.response.url}`; | ||
} | ||
@@ -63,0 +63,0 @@ if (writeStream.destroy) { |
@@ -1,2 +0,2 @@ | ||
import * as got from 'got'; | ||
import { Progress as GotProgress, Options as GotOptions } from 'got'; | ||
import { Downloader } from './Downloader'; | ||
@@ -6,7 +6,9 @@ /** | ||
*/ | ||
export declare type GotDownloaderOptions = got.GotOptions<string | null> & { | ||
export declare type GotDownloaderOptions = (GotOptions & { | ||
isStream?: true; | ||
}) & { | ||
/** | ||
* if defined, triggers every time `got`'s `downloadProgress` event callback is triggered. | ||
*/ | ||
getProgressCallback?: (progress: got.Progress) => Promise<void>; | ||
getProgressCallback?: (progress: GotProgress) => Promise<void>; | ||
/** | ||
@@ -13,0 +15,0 @@ * if `true`, disables the console progress bar (setting the `ELECTRON_GET_NO_PROGRESS` |
@@ -13,3 +13,3 @@ var __rest = (this && this.__rest) || function (s, e) { | ||
import * as fs from 'fs-extra'; | ||
import * as got from 'got'; | ||
import got, { HTTPError } from 'got'; | ||
import * as path from 'path'; | ||
@@ -56,4 +56,4 @@ import * as ProgressBar from 'progress'; | ||
downloadStream.on('error', error => { | ||
if (error.name === 'HTTPError' && error.statusCode === 404) { | ||
error.message += ` for ${error.url}`; | ||
if (error instanceof HTTPError && error.response.statusCode === 404) { | ||
error.message += ` for ${error.response.url}`; | ||
} | ||
@@ -60,0 +60,0 @@ if (writeStream.destroy) { |
{ | ||
"name": "@electron/get", | ||
"version": "1.14.1", | ||
"version": "2.0.0", | ||
"description": "Utility for downloading artifacts from different versions of Electron", | ||
@@ -26,3 +26,3 @@ "main": "dist/cjs/index.js", | ||
"engines": { | ||
"node": ">=8.6" | ||
"node": ">=12" | ||
}, | ||
@@ -33,3 +33,3 @@ "dependencies": { | ||
"fs-extra": "^8.1.0", | ||
"got": "^9.6.0", | ||
"got": "^11.8.5", | ||
"progress": "^2.0.3", | ||
@@ -43,5 +43,4 @@ "semver": "^6.2.0", | ||
"@types/fs-extra": "^8.0.0", | ||
"@types/got": "^9.4.4", | ||
"@types/jest": "^24.0.13", | ||
"@types/node": "^12.0.2", | ||
"@types/node": "^12.20.55", | ||
"@types/progress": "^2.0.3", | ||
@@ -48,0 +47,0 @@ "@types/semver": "^6.2.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
92178
20
1320
+ Added@sindresorhus/is@4.6.0(transitive)
+ Added@szmarczak/http-timer@4.0.6(transitive)
+ Added@types/cacheable-request@6.0.3(transitive)
+ Added@types/http-cache-semantics@4.0.4(transitive)
+ Added@types/keyv@3.1.4(transitive)
+ Added@types/node@22.5.5(transitive)
+ Added@types/responselike@1.0.3(transitive)
+ Addedcacheable-lookup@5.0.4(transitive)
+ Addedcacheable-request@7.0.4(transitive)
+ Addeddecompress-response@6.0.0(transitive)
+ Addeddefer-to-connect@2.0.1(transitive)
+ Addedgot@11.8.6(transitive)
+ Addedhttp2-wrapper@1.0.3(transitive)
+ Addedjson-buffer@3.0.1(transitive)
+ Addedkeyv@4.5.4(transitive)
+ Addedmimic-response@3.1.0(transitive)
+ Addednormalize-url@6.1.0(transitive)
+ Addedp-cancelable@2.1.1(transitive)
+ Addedquick-lru@5.1.1(transitive)
+ Addedresolve-alpn@1.2.1(transitive)
+ Addedresponselike@2.0.1(transitive)
+ Addedundici-types@6.19.8(transitive)
- Removed@sindresorhus/is@0.14.0(transitive)
- Removed@szmarczak/http-timer@1.1.2(transitive)
- Removedcacheable-request@6.1.0(transitive)
- Removeddecompress-response@3.3.0(transitive)
- Removeddefer-to-connect@1.1.3(transitive)
- Removedduplexer3@0.1.5(transitive)
- Removedget-stream@4.1.0(transitive)
- Removedgot@9.6.0(transitive)
- Removedjson-buffer@3.0.0(transitive)
- Removedkeyv@3.1.0(transitive)
- Removedlowercase-keys@1.0.1(transitive)
- Removednormalize-url@4.5.1(transitive)
- Removedp-cancelable@1.1.0(transitive)
- Removedprepend-http@2.0.0(transitive)
- Removedresponselike@1.0.2(transitive)
- Removedto-readable-stream@1.0.0(transitive)
- Removedurl-parse-lax@3.0.0(transitive)
Updatedgot@^11.8.5