nodejs-file-downloader
Advanced tools
Comparing version 4.12.1 to 4.12.2
@@ -0,1 +1,10 @@ | ||
## 4.12.2 29/05/2024 | ||
### Fixed | ||
- Fixed vulnerabilities | ||
- Fixed file path handling | ||
### Added | ||
- Added export to TS types | ||
## 4.12.0 23/05/2023 | ||
@@ -2,0 +11,0 @@ |
@@ -18,2 +18,3 @@ const fs = require('fs'); | ||
const { bufferToReadableStream, createWriteStream, createBufferFromResponseStream, pipeStreams, getStringFromStream } = require('./utils/stream'); | ||
const path = require('path') | ||
@@ -132,3 +133,3 @@ | ||
if (this.config.fileName && this.config.skipExistingFileName) { | ||
if (await exists(this.config.directory + '/' + this.config.fileName)) { | ||
if (await exists(path.join(this.config.directory , this.config.fileName))) { | ||
return true | ||
@@ -227,3 +228,3 @@ } | ||
async _shouldSkipSaving(originalFileName) { | ||
if (this.config.skipExistingFileName && await exists(this.config.directory + '/' + originalFileName)) { | ||
if (this.config.skipExistingFileName && await exists(path.join(this.config.directory , originalFileName))) { | ||
return true; | ||
@@ -230,0 +231,0 @@ } |
@@ -5,3 +5,3 @@ import http from 'http'; | ||
interface DownloaderConfig{ | ||
export interface DownloaderConfig{ | ||
url:string | ||
@@ -27,3 +27,3 @@ directory?:string | ||
interface DownloaderReport{ | ||
export interface DownloaderReport{ | ||
downloadStatus:"COMPLETE"|"ABORTED" | ||
@@ -30,0 +30,0 @@ filePath:string|null |
{ | ||
"name": "nodejs-file-downloader", | ||
"version": "4.12.1", | ||
"version": "4.12.2", | ||
"description": "A file downloader for NodeJs", | ||
@@ -26,3 +26,3 @@ "main": "Downloader.js", | ||
"dependencies": { | ||
"follow-redirects": "^1.15.1", | ||
"follow-redirects": "^1.15.6", | ||
"https-proxy-agent": "^5.0.0", | ||
@@ -48,5 +48,5 @@ "mime-types": "^2.1.27", | ||
"type": "git", | ||
"url": "https://github.com/ibrod83/nodejs-file-downloader.git" | ||
"url": "git+https://github.com/ibrod83/nodejs-file-downloader.git" | ||
}, | ||
"typings": "Downloader.td.ts" | ||
} |
202900
2145
Updatedfollow-redirects@^1.15.6