cas3

1.0.1 • Public • Published

cas3

NPM version Build status Test coverage Dependency Status License Downloads Gittip

S3-backed content addressable storage. Store files by their sha256 sum. Automatically compresses it in S3 if it's compressible.

var cas = new CAS(options)

var CAS = require('cas3')
var cas = new CAS(options)

Options are:

  • bucket - s3 bucket name
  • key - s3 key
  • secret - s3 secret key
  • cdn - optional CDN host, defaulting to the s3 bucket, such as https://lakjsflkajfd.cloudfront.net

cas.key(buffer | string, extension).then( key => )

Get an S3 key from a string or a buffer and an extension.

var key = await cas.key('some string', 'txt')

var url = cas.url(key, cdn?)

Get a URL for the key, depending on whether you'd like to use the S3 bucket directly or a CDN.

Package Sidebar

Install

npm i cas3

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • jongleberry