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

giga

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

giga - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

50

lib/Giga.js

@@ -20,27 +20,2 @@ 'use strict';

/**
* Upload file to the storage
*
* @param {Stream} src
* @param {object} options
* @returns {Promise}
*/
upload(src, options = {}) {
const directory = options.directory || '';
const filename = options.filename || uuidV4();
const filePath = path.posix.join(directory, filename);
const result = {
filePath,
url: url.resolve(this.storage.baseUrl, filePath)
};
if (!src)
throw new TypeError('Source must be stream');
debug(`[upload] path=${result.filePath} url=${result.url}`);
return this.storage.upload(src, filePath)
.then(() => result);
}
/**
* Download file from the storage

@@ -78,2 +53,27 @@ *

/**
* Upload file to the storage
*
* @param {Stream} src
* @param {object} options
* @returns {Promise}
*/
upload(src, options = {}) {
const directory = options.directory || '';
const filename = options.filename || uuidV4();
const filePath = path.posix.join(directory, filename);
const result = {
filePath,
url: url.resolve(this.storage.baseUrl, filePath)
};
if (!src)
throw new TypeError('Source must be stream');
debug(`[upload] path=${result.filePath} url=${result.url}`);
return this.storage.upload(src, filePath)
.then(() => result);
}
/**
* Remove the data from storage

@@ -80,0 +80,0 @@ *

{
"name": "giga",
"version": "0.2.2",
"version": "0.2.3",
"description": "Easy streaming upload and download for storages(File System, AWS S3)",

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

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