1.0.1 • Published 9 years ago
cas3 v1.0.1
cas3
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 namekey
- s3 keysecret
- s3 secret keycdn
- optional CDN host, defaulting to the s3 bucket, such ashttps://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.
1.0.1
9 years ago