🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

@acaprojects/a2-uploads

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@acaprojects/a2-uploads

Angular 2 Interface for direct to cloud uploads

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

Introduction

This project is an Angular2 library for handling secure direct to cloud uploads that are managed by the Condominios project. At CoTag Media we use it to handle all of our file ingestion as it:

  • takes the load away from our API servers
  • allows us to support hybrid cloud models
  • works seamlessly with AWS Lambda and Google Cloud Functions

Effectively this project takes blob or file objects in the browser and

  • Manages an upload queue with pause, resume and progress for each upload
  • Supports configuring individual upload parallelism and the number of simultaneous uploads
  • All files are hashed in webworkers before upload for data integrity
  • Communicates with Condominios to obtain signed requests for the uploads

Usage

  • Optionally bootstrap MD5_WORKER_BASE - this allows you to customise the path of the MD5 worker
  • Bootstrap the MD5Workers - these perform the hashing in webworkers and should only be instansitated once
  • In the components you wish to perform uploads, inject your Http service and the MD5Workers
  • Import UploadManager and the storage providers you wish to use Amazon, Google, Azure, OpenStack
  • Add the providers to the upload manager: UploadManager.addProvider(Amazon);

You can now use the manager


this.manager = new UploadManager(http, '/uploads', workers);
this.manager.autoStart = true;

// ...

// Add files to the upload manager
// Files is an array of Blobs or Files -> https://developer.mozilla.org/en/docs/Web/API/File
this.manager.upload(files);

Building from src

The project is written in typescript and transpiled into ES5.

  • Install TypeScript: npm install -g typescript (if you haven't already)
  • Configure compile options in tsconfig.json
  • Perform build using: tsc or build script below

You can find more information here: https://github.com/Microsoft/TypeScript/wiki/tsconfig.json

Scripts

  • Build Script: npm run build
  • Test Script: npm run test

Publishing

License

MIT

Keywords

angular2

FAQs

Package last updated on 08 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts