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

careful-downloader

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

careful-downloader - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

14

index.js

@@ -12,2 +12,10 @@ import path from "path";

export default async function downloader(downloadUrl, checksumUrl, options) {
options = options || {};
// don't delete the temp dir if set manually and dir exists
let deleteTempDir = true;
if (options.tempDir && fs.pathExistsSync(options.tempDir)) {
deleteTempDir = false;
}
// normalize options and set defaults

@@ -52,4 +60,6 @@ options = {

} finally {
// delete temporary directory
await fs.remove(options.tempDir);
// delete temporary directory (except for edge cases above)
if (deleteTempDir) {
await fs.remove(options.tempDir);
}
}

@@ -56,0 +66,0 @@ }

2

package.json
{
"name": "careful-downloader",
"version": "1.0.1",
"version": "1.1.0",
"description": "🕵️‍♀️ Downloads a file and its checksums to a temporary directory, validates the hash, and optionally extracts it if safe.",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -80,3 +80,3 @@ # 🕵️‍♀️ careful-downloader

Path to temporary directory for unverified and/or unextracted downloads. Automatically generated if not set (recommended).
Path to temporary directory for unverified and/or unextracted downloads. Automatically generated if not set (recommended). If set manually, the directory isn't purged upon finishing for security reasons.

@@ -83,0 +83,0 @@ ##### destDir

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