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

s3asy

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

s3asy

Simple S3 integration with a cache backed by Redis

  • 0.4.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Introduction

s3asy ('S-Three-Zee') is a simple library for issuing GET, PUT, and DELETE requests against Amazon S3. It allows caching of files in a local redis instance using the If-Modified-Since and ```Date```` headers as cache-control.

It achieves this simplicity by utilizing knox and cacheit under the hood.

Warning: Don't use this for large objects, as it obviously buffers them in memory. Also Redis cannot cash strings larger than 512 MB.

Example

var S3 = require('s3asy');
var s3 = new S3({
  key: '<api-key-here>',
  secret: '<secret-here>',
  bucket: 'bucket-name',
  cache: true
});

s3.get('/some/path', {'x-amz-acl': 'private'}, function(err, body) {
  console.log(body);
});

API

s3.get(path, [headers], callback)

s3.put(path, headers, data, callback)

Requires Content-Type and Content-Length headers

s3.delete(path, [headers], callback)

s3.copy(dst_path, src_path, src_bucket, headers, callback)

  • dst_path - the destination filename
  • src_path - the source filename
  • src_bucket - the source bucket. The dst_bucket is the bucket passed to the constructor.

Requires Content-Type and Content-Length headers

s3.ls(path, callback)

List files with a given prefix (path). Do NOT use a leading slash.

Run Tests

Ensure you have mocha installed.

npm install mocha

Add a config file for s3asy to use in ~/.s3asy_test_config.js.

module.exports = {
  key: '<api-key-here>',
  secret: '<secret-here>',
  bucket: 'bucket-name',
  cache: true
};

Run tests

cd test
mocha test.js --reporter spec 

FAQs

Package last updated on 03 Oct 2012

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

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