MCPcopy
hub / github.com/TTLabs/EvaporateJS

github.com/TTLabs/EvaporateJS @2.1.4 sqlite

repository ↗ · DeepWiki ↗ · release 2.1.4 ↗
96 symbols 257 edges 28 files 2 documented · 2%
README

Evaporate

Build Status Code Climate

File Upload API for AWS S3

Evaporate is a javascript library for uploading files from a browser to AWS S3, using parallel S3's multipart uploads with MD5 checksum support and control over pausing / resuming the upload.

Major features include:

  • Configurable number of parallel uploads for each part (maxConcurrentParts)
  • Configurable MD5 Checksum calculations and handling for each uploaded part (computeContentMd5)
  • AWS Signature Version 2 and 4 (awsSignatureVersion)
  • S3 Transfer Acceleration (s3Acceleration)
  • Robust recovery when uploading huge files. Only parts that have not been fully uploaded again. (s3FileCacheHoursAgo, allowS3ExistenceOptimization)
  • Ability to pause and resume downloads at will
  • Pluggable signing methods to support AWS Lambda, async functions and more.

New Features in v2.0: - Parallel file uploads while respecting maxConcurrentParts. - If Evaporate reuses an interrupted upload or avoids uploading a file that is already available on S3, the new callback nameChanged will be invoked with the previous object name at the earliest moment. This indicates that requested object name was not used. - Pause, Resume, Cancel now can act on all in-progress file uploads - Pluggable signing methods with customAuthMethod. AWS Lambda functions must be implemented through this option. - Signing methods can respond to 401 and 403 response statuses and not trigger the automatic retry feature. - The progress() and complete() callbacks now provide upload stats like transfer rate and time remaining. - Reduced memory footprint when calculating MD5 digests.

New Features in v2.0.5: - Support for Node.js FileSystem (fs) ReadbleStreams. This means you can use Electron to upload a file directly from the file system's native File picker and avoid the usual browser restrictions.

To migrate to v2.0, follow these instructions.

Installation

Evaporate is published as a Node module:

$ npm install evaporate

Otherwise, include it in your HTML:

<script language="javascript" type="text/javascript" src="https://github.com/TTLabs/EvaporateJS/raw/2.1.4/evaporate.js"></script>

Example

require('crypto');

var config = {
     signerUrl: <SIGNER_URL>,
     aws_key: <AWS_KEY>,
     bucket: <AWS_BUCKET>,
     cloudfront: true,
     computeContentMd5: true,
     cryptoMd5Method: function (data) { return crypto.createHash('md5').update(data).digest('base64'); }
};

return Evaporate.create(config)
    .then(function (evaporate) {

      var file = new File([""], "file_object_to_upload"),
          addConfig = {
            name: file.name,
            file: file,
            progress: function (progressValue) { console.log('Progress', progressValue); },
            complete: function (_xhr, awsKey) { console.log('Complete!'); },
          },
          overrides = {
            bucket: AWS_BUCKET // Shows that the bucket can be changed per
          };
      evaporate.add(addConfig, overrides)
          .then(function (awsObjectKey) {
                console.log('File successfully uploaded to:', awsObjectKey);
              },
              function (reason) {
                console.log('File did not upload sucessfully:', reason);
              });
    });

See more examples on wiki.

API documentation

Check out Browser Compatibility and Important Usage Notes for usage details.

Authors

License

EvaporateJS is licensed under the BSD 3-Clause License http://opensource.org/licenses/BSD-3-Clause

Core symbols most depended-on inside this repo

resolve
called by 23
evaporate.js
reject
called by 16
evaporate.js
extend
called by 12
evaporate.js
elementText
called by 9
evaporate.js
storeTestRequest
called by 8
test/helpers/browser-env.js
removeAtIndex
called by 7
evaporate.js
uploadKey
called by 6
evaporate.js
getSavedUploads
called by 5
evaporate.js

Shape

Function 85
Method 7
Class 4

Languages

TypeScript89%
Python6%
Java5%

Modules by API surface

evaporate.js43 symbols
test/auth.spec.js16 symbols
test/common-case.spec.js6 symbols
test/helpers/browser-env.js5 symbols
test/cancel-abort.spec.js4 symbols
example/awsv4_signing_example.py4 symbols
example/SigningExample.java3 symbols
test/pause-resume.spec.js2 symbols
test/evaporate.spec.js2 symbols
example/signing_example.py2 symbols
example/SigningExample-awsv4.js2 symbols
example/ServerTimeExample.java2 symbols

Dependencies from manifests, versioned

ava0.16.0 · 1×
babel-cli6.14.0 · 1×
babel-preset-es20156.14.0 · 1×
babel-register6.14.0 · 1×
chai3.5.0 · 1×
codeclimate-test-reporter0.3.3 · 1×
electron1.4.1 · 1×
evaporateTTLabs/EvaporateJS#2 · 1×
file-api0.10.4 · 1×
jsdom9.4.2 · 1×
nyc7.1.0 · 1×
sinon1.17.6 · 1×

For agents

$ claude mcp add EvaporateJS \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact