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

ipull

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ipull - npm Package Compare versions

Comparing version 3.0.7 to 3.0.8

dist/download/download-engine/download-file/download-programs/base-download-program.d.ts

3

dist/browser.d.ts

@@ -13,3 +13,4 @@ import { downloadFileBrowser, DownloadFileBrowserOptions, downloadSequenceBrowser } from "./download/browser-download.js";

import DownloadEngineMultiDownload from "./download/download-engine/engine/download-engine-multi-download.js";
export { downloadFileBrowser, downloadSequenceBrowser, EmptyResponseError, StatusCodeError, XhrError, InvalidContentLengthError, FetchStreamError, IpullError, EngineError };
import HttpError from "./download/download-engine/streams/download-engine-fetch-stream/errors/http-error.js";
export { downloadFileBrowser, downloadSequenceBrowser, EmptyResponseError, HttpError, StatusCodeError, XhrError, InvalidContentLengthError, FetchStreamError, IpullError, EngineError };
export type { DownloadFileBrowserOptions, DownloadEngineBrowser, DownloadEngineMultiDownload, FormattedStatus, SaveProgressInfo };

@@ -9,3 +9,4 @@ import { downloadFileBrowser, downloadSequenceBrowser } from "./download/browser-download.js";

import EngineError from "./download/download-engine/engine/error/engine-error.js";
export { downloadFileBrowser, downloadSequenceBrowser, EmptyResponseError, StatusCodeError, XhrError, InvalidContentLengthError, FetchStreamError, IpullError, EngineError };
import HttpError from "./download/download-engine/streams/download-engine-fetch-stream/errors/http-error.js";
export { downloadFileBrowser, downloadSequenceBrowser, EmptyResponseError, HttpError, StatusCodeError, XhrError, InvalidContentLengthError, FetchStreamError, IpullError, EngineError };
//# sourceMappingURL=browser.js.map

@@ -1,2 +0,2 @@

import ProgressStatusFile, { ProgressStatus } from "./progress-status-file.js";
import ProgressStatusFile, { DownloadStatus, ProgressStatus } from "./progress-status-file.js";
import { DownloadFile, SaveProgressInfo } from "../types.js";

@@ -8,2 +8,3 @@ import BaseDownloadEngineFetchStream from "../streams/download-engine-fetch-stream/base-download-engine-fetch-stream.js";

import { AvailablePrograms } from "./download-programs/switch-program.js";
import BaseDownloadProgram from "./download-programs/base-download-program.js";
export type DownloadEngineFileOptions = {

@@ -44,2 +45,4 @@ chunkSize?: number;

};
protected _activeProgram?: BaseDownloadProgram;
protected _downloadStatus: DownloadStatus;
constructor(file: DownloadFile, options: DownloadEngineFileOptions);

@@ -46,0 +49,0 @@ get downloadSize(): number;

@@ -1,2 +0,2 @@

import ProgressStatusFile from "./progress-status-file.js";
import ProgressStatusFile, { DownloadStatus } from "./progress-status-file.js";
import { ChunkStatus } from "../types.js";

@@ -22,2 +22,4 @@ import { EventEmitter } from "eventemitter3";

_activeStreamBytes = {};
_activeProgram;
_downloadStatus = DownloadStatus.Active;
constructor(file, options) {

@@ -37,3 +39,3 @@ super();

get status() {
return this._progressStatus.createStatus(this._progress.part + 1, this.transferredBytes);
return this._progressStatus.createStatus(this._progress.part + 1, this.transferredBytes, this._downloadStatus);
}

@@ -74,2 +76,4 @@ get _activePart() {

for (let i = this._progress.part; i < this.file.parts.length; i++) {
if (this._closed)
return;
// If we are starting a new part, we need to reset the progress

@@ -90,6 +94,9 @@ if (i > this._progress.part || !this._activePart.acceptRange) {

this._activeStreamBytes = {};
const downloadProgram = switchProgram(this._progress, this._downloadSlice.bind(this), this.options.fetchStream.programType || this.options.programType);
await downloadProgram.download();
this._activeProgram = switchProgram(this._progress, this._downloadSlice.bind(this), this.options.fetchStream.programType || this.options.programType);
await this._activeProgram.download();
}
if (this._closed)
return;
this._progressStatus.finished();
this._downloadStatus = DownloadStatus.Finished;
await this._saveProgress();

@@ -153,2 +160,4 @@ this.emit("finished");

_sendProgressDownloadPart() {
if (this._closed)
return;
this.emit("progress", this.status);

@@ -160,4 +169,6 @@ }

}
this._downloadStatus = DownloadStatus.Paused;
this.options.fetchStream.emit("paused");
this.emit("paused");
this._sendProgressDownloadPart();
}

@@ -168,2 +179,3 @@ resume() {

}
this._downloadStatus = DownloadStatus.Active;
this.options.fetchStream.emit("resumed");

@@ -175,7 +187,12 @@ this.emit("resumed");

return;
if (this._downloadStatus !== DownloadStatus.Finished) {
this._downloadStatus = DownloadStatus.Cancelled;
}
this._sendProgressDownloadPart();
this._closed = true;
this._activeProgram?.abort();
await this.options.onCloseAsync?.();
await this.options.writeStream.close();
await this.options.fetchStream.close();
this.emit("closed");
await this.options.onCloseAsync?.();
}

@@ -182,0 +199,0 @@ [Symbol.dispose]() {

import { SaveProgressInfo } from "../../types.js";
import BaseDownloadStream, { DownloadSlice, ProgramSlice } from "./base-download-stream.js";
export default class DownloadProgramChunks extends BaseDownloadStream {
import BaseDownloadProgram, { DownloadSlice, ProgramSlice } from "./base-download-program.js";
export default class DownloadProgramChunks extends BaseDownloadProgram {
constructor(savedProgress: SaveProgressInfo, downloadSlice: DownloadSlice);
protected _createOneSlice(): ProgramSlice | null;
}
import { ChunkStatus } from "../../types.js";
import BaseDownloadStream from "./base-download-stream.js";
export default class DownloadProgramChunks extends BaseDownloadStream {
import BaseDownloadProgram from "./base-download-program.js";
export default class DownloadProgramChunks extends BaseDownloadProgram {
constructor(savedProgress, downloadSlice) {

@@ -5,0 +5,0 @@ super(savedProgress, downloadSlice);

import { SaveProgressInfo } from "../../types.js";
import BaseDownloadStream, { DownloadSlice, ProgramSlice } from "./base-download-stream.js";
export default class DownloadProgramStream extends BaseDownloadStream {
import BaseDownloadProgram, { DownloadSlice, ProgramSlice } from "./base-download-program.js";
export default class DownloadProgramStream extends BaseDownloadProgram {
constructor(savedProgress: SaveProgressInfo, downloadSlice: DownloadSlice);

@@ -5,0 +5,0 @@ protected _createOneSlice(): ProgramSlice | null;

import { ChunkStatus } from "../../types.js";
import BaseDownloadStream from "./base-download-stream.js";
export default class DownloadProgramStream extends BaseDownloadStream {
import BaseDownloadProgram from "./base-download-program.js";
export default class DownloadProgramStream extends BaseDownloadProgram {
constructor(savedProgress, downloadSlice) {

@@ -5,0 +5,0 @@ super(savedProgress, downloadSlice);

import { SaveProgressInfo } from "../../types.js";
import { DownloadSlice } from "./base-download-stream.js";
import { DownloadSlice } from "./base-download-program.js";
import DownloadProgramChunks from "./download-program-chunks.js";

@@ -4,0 +4,0 @@ import DownloadProgramStream from "./download-program-stream.js";

@@ -11,3 +11,11 @@ export type ProgressStatus = {

transferAction: string;
downloadStatus: DownloadStatus;
};
export declare enum DownloadStatus {
Active = "Active",
Paused = "Paused",
Finished = "Finished",
Cancelled = "Cancelled",
Error = "Error"
}
export default class ProgressStatusFile {

@@ -21,8 +29,9 @@ readonly totalBytes: number;

readonly transferAction: string;
readonly downloadStatus: DownloadStatus;
startTime: number;
endTime: number;
constructor(totalBytes: number, totalDownloadParts: number, fileName: string, comment?: string, transferAction?: string, downloadPart?: number, transferredBytes?: number);
constructor(totalBytes: number, totalDownloadParts: number, fileName: string, comment?: string, transferAction?: string, downloadPart?: number, transferredBytes?: number, downloadStatus?: DownloadStatus);
started(): void;
finished(): void;
createStatus(downloadPart: number, transferredBytes: number): ProgressStatusFile;
createStatus(downloadPart: number, transferredBytes: number, downloadStatus?: DownloadStatus): ProgressStatusFile;
}

@@ -0,1 +1,9 @@

export var DownloadStatus;
(function (DownloadStatus) {
DownloadStatus["Active"] = "Active";
DownloadStatus["Paused"] = "Paused";
DownloadStatus["Finished"] = "Finished";
DownloadStatus["Cancelled"] = "Cancelled";
DownloadStatus["Error"] = "Error";
})(DownloadStatus || (DownloadStatus = {}));
export default class ProgressStatusFile {

@@ -9,5 +17,6 @@ totalBytes;

transferAction;
downloadStatus = DownloadStatus.Active;
startTime = 0;
endTime = 0;
constructor(totalBytes, totalDownloadParts, fileName, comment, transferAction = "Transferring", downloadPart = 0, transferredBytes = 0) {
constructor(totalBytes, totalDownloadParts, fileName, comment, transferAction = "Transferring", downloadPart = 0, transferredBytes = 0, downloadStatus = DownloadStatus.Active) {
this.transferAction = transferAction;

@@ -20,2 +29,3 @@ this.transferredBytes = transferredBytes;

this.totalBytes = totalBytes;
this.downloadStatus = downloadStatus;
}

@@ -28,4 +38,4 @@ started() {

}
createStatus(downloadPart, transferredBytes) {
const newStatus = new ProgressStatusFile(this.totalBytes, this.totalDownloadParts, this.fileName, this.comment, this.transferAction, downloadPart, transferredBytes);
createStatus(downloadPart, transferredBytes, downloadStatus = DownloadStatus.Active) {
const newStatus = new ProgressStatusFile(this.totalBytes, this.totalDownloadParts, this.fileName, this.comment, this.transferAction, downloadPart, transferredBytes, downloadStatus);
newStatus.startTime = this.startTime;

@@ -32,0 +42,0 @@ newStatus.endTime = this.endTime;

@@ -25,6 +25,2 @@ import BaseDownloadEngine from "./base-download-engine.js";

_init() {
this._progressStatisticsBuilder.add(...this._engines);
this._progressStatisticsBuilder.on("progress", progress => {
this.emit("progress", progress);
});
this._changeEngineFinishDownload();

@@ -38,2 +34,6 @@ for (const [index, engine] of Object.entries(this._engines)) {

}
this._progressStatisticsBuilder.add(...this._engines);
this._progressStatisticsBuilder.on("progress", progress => {
this.emit("progress", progress);
});
}

@@ -40,0 +40,0 @@ async download() {

@@ -31,2 +31,6 @@ import { DownloadFile } from "../types.js";

/**
* Abort the download & delete the file (if it exists)
*/
closeAndDeleteFile(): Promise<void>;
/**
* Download/copy a file

@@ -33,0 +37,0 @@ *

@@ -29,7 +29,19 @@ import path from "path";

this._engine.options.onCloseAsync = async () => {
const closedFileName = this.options.writeStream.path.slice(0, -PROGRESS_FILE_EXTENSION.length);
await fs.rename(this.options.writeStream.path, closedFileName);
if (this.status.ended) {
const closedFileName = this.options.writeStream.path.slice(0, -PROGRESS_FILE_EXTENSION.length);
await fs.rename(this.options.writeStream.path, closedFileName);
}
};
}
/**
* Abort the download & delete the file (if it exists)
*/
async closeAndDeleteFile() {
await this.close();
try {
await fs.unlink(this.options.writeStream.path);
}
catch { }
}
/**
* Download/copy a file

@@ -36,0 +48,0 @@ *

import retry from "async-retry";
import { retryAsyncStatementSimple } from "./utils/retry-async-statement.js";
import { EventEmitter } from "eventemitter3";
import HttpError from "./errors/http-error.js";
const DEFAULT_OPTIONS = {
retry: {
retries: 150,
factor: 1.5,
minTimeout: 200,
maxTimeout: 5000
}
};
export default class BaseDownloadEngineFetchStream extends EventEmitter {

@@ -14,3 +23,3 @@ programType;

super();
this.options = options;
this.options = { ...DEFAULT_OPTIONS, ...options };
this.initEvents();

@@ -50,3 +59,4 @@ }

async fetchDownloadInfo(url) {
return this.options.defaultFetchDownloadInfo ?? await retry(async () => {
let throwErr = null;
const response = this.options.defaultFetchDownloadInfo ?? await retry(async () => {
try {

@@ -56,2 +66,6 @@ return await this.fetchDownloadInfoWithoutRetry(url);

catch (error) {
if (error instanceof HttpError) {
throwErr = error;
return null;
}
this.errorCount.value++;

@@ -62,2 +76,6 @@ this.emit("errorCountIncreased", this.errorCount.value, error);

}, this.options.retry);
if (throwErr) {
throw throwErr;
}
return response;
}

@@ -75,2 +93,5 @@ async fetchChunks(callback) {

return;
if (error instanceof HttpError) {
throw error;
}
if (lastStartLocation !== this.state.startChunk) {

@@ -77,0 +98,0 @@ lastStartLocation = this.state.startChunk;

import BaseDownloadEngineFetchStream from "./base-download-engine-fetch-stream.js";
import InvalidContentLengthError from "./errors/invalid-content-length-error.js";
import SmartChunkSplit from "./utils/smart-chunk-split.js";
import { parseContentDisposition } from "./utils/content-disposition.js";
import StatusCodeError from "./errors/status-code-error.js";
export default class DownloadEngineFetchStreamFetch extends BaseDownloadEngineFetchStream {

@@ -11,14 +13,15 @@ transferAction = "Downloading";

async fetchWithoutRetryChunks(callback) {
const headers = {
accept: "*/*",
...this.options.headers,
range: `bytes=${this._startSize}-${this._endSize - 1}`
};
const controller = new AbortController();
const response = await fetch(this.appendToURL(this.state.url), {
headers: {
accept: "*/*",
...this.options.headers,
range: `bytes=${this._startSize}-${this._endSize - 1}`
},
headers,
signal: controller.signal
});
this.on("aborted", () => {
controller.abort();
});
if (response.status < 200 || response.status >= 300) {
throw new StatusCodeError(this.state.url, response.status, response.statusText, headers);
}
const contentLength = parseInt(response.headers.get("content-length"));

@@ -29,2 +32,5 @@ const expectedContentLength = this._endSize - this._startSize;

}
this.on("aborted", () => {
controller.abort();
});
const reader = response.body.getReader();

@@ -38,6 +44,8 @@ return await this.chunkGenerator(callback, () => reader.read());

});
if (response.status < 200 || response.status >= 300) {
throw new StatusCodeError(url, response.status, response.statusText, this.options.headers);
}
const length = parseInt(response.headers.get("content-length"));
const acceptRange = this.options.acceptRangeIsKnown ?? response.headers.get("accept-ranges") === "bytes";
const fileName = response.headers.get("content-disposition")
?.match(/filename="(.+)"/)?.[1];
const fileName = parseContentDisposition(response.headers.get("content-disposition"));
return {

@@ -44,0 +52,0 @@ length,

@@ -7,2 +7,3 @@ import BaseDownloadEngineFetchStream from "./base-download-engine-fetch-stream.js";

import retry from "async-retry";
import { parseContentDisposition } from "./utils/content-disposition.js";
export default class DownloadEngineFetchStreamXhr extends BaseDownloadEngineFetchStream {

@@ -111,4 +112,3 @@ programType = "chunks";

const length = xhr.getResponseHeader("Content-Length") || "-";
const fileName = xhr.getResponseHeader("content-disposition")
?.match(/filename="(.+)"/)?.[1];
const fileName = parseContentDisposition(xhr.getResponseHeader("content-disposition"));
const acceptRange = this.options.acceptRangeIsKnown ?? xhr.getResponseHeader("Accept-Ranges") === "bytes";

@@ -115,0 +115,0 @@ resolve({

@@ -1,4 +0,4 @@

import FetchStreamError from "./fetch-stream-error.js";
export default class InvalidContentLengthError extends FetchStreamError {
import HttpError from "./http-error.js";
export default class InvalidContentLengthError extends HttpError {
constructor(expectedLength: number, gotLength: number);
}

@@ -1,3 +0,3 @@

import FetchStreamError from "./fetch-stream-error.js";
export default class InvalidContentLengthError extends FetchStreamError {
import HttpError from "./http-error.js";
export default class InvalidContentLengthError extends HttpError {
constructor(expectedLength, gotLength) {

@@ -4,0 +4,0 @@ super(`Expected ${expectedLength} bytes, but got ${gotLength} bytes. If you on browser try to set "ignoreIfRangeWithQueryParams" to true, this will add a "_ignore" query parameter to the URL to avoid chrome "if-range" header.`);

@@ -1,3 +0,3 @@

import FetchStreamError from "./fetch-stream-error.js";
export default class StatusCodeError extends FetchStreamError {
import HttpError from "./http-error.js";
export default class StatusCodeError extends HttpError {
readonly url: string;

@@ -4,0 +4,0 @@ readonly statusCode: number;

@@ -1,3 +0,3 @@

import FetchStreamError from "./fetch-stream-error.js";
export default class StatusCodeError extends FetchStreamError {
import HttpError from "./http-error.js";
export default class StatusCodeError extends HttpError {
url;

@@ -4,0 +4,0 @@ statusCode;

@@ -52,15 +52,21 @@ import fs from "fs/promises";

const fd = await this._ensureFileOpen();
const state = await fd.stat();
const metadataSize = state.size - this.fileSize;
if (metadataSize <= 0) {
return;
}
const metadataBuffer = Buffer.alloc(metadataSize);
await fd.read(metadataBuffer, 0, metadataSize, this.fileSize);
const decoder = new TextDecoder();
const metadataString = decoder.decode(metadataBuffer);
try {
return JSON.parse(metadataString);
const state = await fd.stat();
const metadataSize = state.size - this.fileSize;
if (metadataSize <= 0) {
return;
}
const metadataBuffer = Buffer.alloc(metadataSize);
await fd.read(metadataBuffer, 0, metadataSize, this.fileSize);
const decoder = new TextDecoder();
const metadataString = decoder.decode(metadataBuffer);
try {
return JSON.parse(metadataString);
}
catch { }
}
catch { }
finally {
this._fd = null;
await fd.close();
}
}

@@ -67,0 +73,0 @@ async _writeWithoutRetry(cursor, buffer) {

import prettyBytes from "pretty-bytes";
import prettyMilliseconds from "pretty-ms";
import { DownloadStatus } from "../download-engine/download-file/progress-status-file.js";
const DEFAULT_LOCALIZATION = "en-US";

@@ -42,2 +43,11 @@ const NUMBER_FORMAT_OPTIONS = {

.slice(0, 5) + "%";
let fullComment = fullStatus.comment;
if (status.downloadStatus === DownloadStatus.Cancelled || status.downloadStatus === DownloadStatus.Paused) {
if (fullComment) {
fullComment += " | " + status.downloadStatus;
}
else {
fullComment = status.downloadStatus;
}
}
return {

@@ -51,5 +61,5 @@ ...fullStatus,

formattedPercentage,
formattedComment: fullStatus.comment ? `(${fullStatus.comment})` : ""
formattedComment: fullComment ? `(${fullComment})` : ""
};
}
//# sourceMappingURL=format-transfer-status.js.map

@@ -8,11 +8,11 @@ import UpdateManager from "stdout-update";

export default abstract class BaseLoadingAnimation {
private _intervalId?;
protected options: BaseLoadingAnimationOptions;
protected stdoutManager: UpdateManager;
protected _animationActive: boolean;
protected constructor(options?: BaseLoadingAnimationOptions);
protected _render(): void;
protected abstract createFrame(): string;
start(): void;
start(): Promise<void>;
stop(): void;
private _processExit;
}
import UpdateManager from "stdout-update";
import sleep from "sleep-promise";
export const DEFAULT_LOADING_ANIMATION_OPTIONS = {

@@ -7,5 +8,5 @@ loadingText: "Gathering information"

export default class BaseLoadingAnimation {
_intervalId;
options;
stdoutManager = UpdateManager.getInstance();
_animationActive = false;
constructor(options = DEFAULT_LOADING_ANIMATION_OPTIONS) {

@@ -18,15 +19,19 @@ this.options = options;

}
start() {
async start() {
process.on("SIGINT", this._processExit);
this.stdoutManager.hook();
this._intervalId = setInterval(this._render.bind(this), this.options.updateIntervalMs ?? DEFAULT_UPDATE_INTERVAL_MS);
this._animationActive = true;
while (this._animationActive) {
this._render();
await sleep(this.options.updateIntervalMs ?? DEFAULT_UPDATE_INTERVAL_MS);
}
}
stop() {
if (this._intervalId) {
this.stdoutManager.erase();
this.stdoutManager.unhook(false);
clearInterval(this._intervalId);
this._intervalId = undefined;
process.off("SIGINT", this._processExit);
if (!this._animationActive) {
return;
}
this._animationActive = false;
this.stdoutManager.erase();
this.stdoutManager.unhook(false);
process.off("SIGINT", this._processExit);
}

@@ -33,0 +38,0 @@ _processExit() {

@@ -9,2 +9,3 @@ import chalk from "chalk";

import stripAnsi from "strip-ansi";
import { DownloadStatus } from "../../../download-engine/download-file/progress-status-file.js";
const minNameLength = 20;

@@ -95,3 +96,12 @@ const minCommentLength = 15;

getNameAndCommentDataParts() {
const { fileName, comment } = this.status;
const { fileName, comment, downloadStatus } = this.status;
let fullComment = comment;
if (downloadStatus === DownloadStatus.Cancelled || downloadStatus === DownloadStatus.Paused) {
if (fullComment) {
fullComment += " | " + downloadStatus;
}
else {
fullComment = downloadStatus;
}
}
return [{

@@ -111,3 +121,3 @@ type: "name",

formatter: (text) => chalk.bold(text)
}, ...((comment == null || comment.length === 0)
}, ...((fullComment == null || fullComment.length === 0)
? []

@@ -121,5 +131,5 @@ : [{

type: "nameComment",
fullText: comment,
size: Math.min(comment.length, minCommentLength),
maxSize: comment.length,
fullText: fullComment,
size: Math.min(fullComment.length, minCommentLength),
maxSize: fullComment.length,
flex: 1,

@@ -191,3 +201,3 @@ cropper: truncateText,

renderStatusLine() {
if (this.status.ended) {
if (this.status.downloadStatus === DownloadStatus.Finished || this.status.downloadStatus === DownloadStatus.Error) {
return this.renderFinishedLine();

@@ -194,0 +204,0 @@ }

@@ -27,2 +27,5 @@ import UpdateManager from "stdout-update";

protected myCLILevel: number;
protected latestProgress: FormattedStatus[];
private _cliStopped;
private readonly _updateStatuesDebounce;
constructor(options: Partial<TransferCliOptions>, myCLILevel?: CLI_LEVEL);

@@ -33,3 +36,4 @@ start(): void;

updateStatues(statues: FormattedStatus[]): void;
private _updateStatues;
protected _logUpdate(text: string): void;
}

@@ -25,6 +25,9 @@ import UpdateManager from "stdout-update";

myCLILevel;
latestProgress = [];
_cliStopped = true;
_updateStatuesDebounce;
constructor(options, myCLILevel = CLI_LEVEL.LOW) {
TransferCli.activeCLILevel = this.myCLILevel = myCLILevel;
this.options = { ...DEFAULT_TRANSFER_CLI_OPTIONS, ...options };
this.updateStatues = debounce(this.updateStatues.bind(this), this.options.debounceWait, {
this._updateStatuesDebounce = debounce(this._updateStatues.bind(this), this.options.debounceWait, {
maxWait: this.options.maxDebounceWait

@@ -38,2 +41,5 @@ });

start() {
if (this.myCLILevel !== TransferCli.activeCLILevel)
return;
this._cliStopped = false;
this.stdoutManager.hook();

@@ -43,2 +49,6 @@ process.on("SIGINT", this._processExit);

stop() {
if (this._cliStopped || this.myCLILevel !== TransferCli.activeCLILevel)
return;
this._updateStatues();
this._cliStopped = true;
this.stdoutManager.unhook(false);

@@ -52,6 +62,10 @@ process.off("SIGINT", this._processExit);

updateStatues(statues) {
if (this.myCLILevel !== TransferCli.activeCLILevel) {
this.latestProgress = statues;
this._updateStatuesDebounce();
}
_updateStatues() {
if (this._cliStopped || this.myCLILevel !== TransferCli.activeCLILevel) {
return; // Do not update if there is a higher level CLI, meaning that this CLI is sub-CLI
}
const newLog = statues.map((status) => {
const newLog = this.latestProgress.map((status) => {
status.transferAction = this.options.action ?? status.transferAction;

@@ -58,0 +72,0 @@ return this.options.createProgressBar(status);

@@ -14,3 +14,4 @@ import DownloadEngineNodejs from "./download/download-engine/engine/download-engine-nodejs.js";

import DownloadEngineMultiDownload from "./download/download-engine/engine/download-engine-multi-download.js";
export { downloadFile, downloadSequence, PathNotAFileError, EmptyResponseError, StatusCodeError, XhrError, InvalidContentLengthError, FetchStreamError, IpullError, EngineError };
import HttpError from "./download/download-engine/streams/download-engine-fetch-stream/errors/http-error.js";
export { downloadFile, downloadSequence, PathNotAFileError, EmptyResponseError, HttpError, StatusCodeError, XhrError, InvalidContentLengthError, FetchStreamError, IpullError, EngineError };
export type { DownloadFileOptions, DownloadSequenceOptions, DownloadEngineNodejs, DownloadEngineMultiDownload, SaveProgressInfo, FormattedStatus };

@@ -10,3 +10,4 @@ import { downloadFile, downloadSequence } from "./download/node-download.js";

import EngineError from "./download/download-engine/engine/error/engine-error.js";
export { downloadFile, downloadSequence, PathNotAFileError, EmptyResponseError, StatusCodeError, XhrError, InvalidContentLengthError, FetchStreamError, IpullError, EngineError };
import HttpError from "./download/download-engine/streams/download-engine-fetch-stream/errors/http-error.js";
export { downloadFile, downloadSequence, PathNotAFileError, EmptyResponseError, HttpError, StatusCodeError, XhrError, InvalidContentLengthError, FetchStreamError, IpullError, EngineError };
//# sourceMappingURL=index.js.map
{
"name": "ipull",
"version": "3.0.7",
"version": "3.0.8",
"description": "The only file downloader you'll ever need. For node.js and the browser, CLI and library for fast and reliable file downloads.",

@@ -127,2 +127,3 @@ "main": "dist/index.js",

"dependencies": {
"@tinyhttp/content-disposition": "^2.2.0",
"async-retry": "^1.3.3",

@@ -141,2 +142,3 @@ "chalk": "^5.3.0",

"pretty-ms": "^8.0.0",
"sleep-promise": "^9.1.0",
"slice-ansi": "^7.1.0",

@@ -143,0 +145,0 @@ "stdout-update": "^4.0.1",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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