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

@infurnia/backend-file-storage

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@infurnia/backend-file-storage - npm Package Compare versions

Comparing version 2.12.0 to 2.13.0

14

index.js

@@ -163,2 +163,16 @@ const utils = require('./utils');

//downloads gcs object as a file
downloadFile = async(sourceFilePath, destFilePath) => {
try{
sourceFilePath = clean_file_path(sourceFilePath, false);
console.debug(sourceFilePath, destFilePath);
return (await this.gcs_client.download_file(this.bucket_name, sourceFilePath, destFilePath));
}
catch(err){
console.error(`error in file_storage/index.js/downloadFile`);
console.error(err);
throw err;
}
}
//gets a signed url for an object with read permission

@@ -165,0 +179,0 @@ getSignedUrl = async(filePath) => {

@@ -117,2 +117,17 @@ const {Storage} = require('@google-cloud/storage');

//read file contents
download_file = async(bucket_name, key, destination_path) => {
try{
if (!bucket_name) throw new Error(`bucket_name must be specified`);
if (!key) throw new Error(`key must be specified`);
const gcs_file = this.gcsClient.bucket(bucket_name).file(key);
await gcs_file.download({ destination: destination_path});
return "OK";
}
catch(err){
console.error(err);
throw err;
}
}
//get signed url

@@ -119,0 +134,0 @@ get_signed_url = async(bucket_name, key, permission='read', expiry_in_secs=600) => {

2

package.json
{
"name": "@infurnia/backend-file-storage",
"version": "2.12.0",
"version": "2.13.0",
"description": "Storage engine for google cloud storage",

@@ -5,0 +5,0 @@ "main": "index.js",

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