
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Amazon S3 adapter for catbox.
bucket
- the S3 bucket. You need to have write access for it.accessKeyId
- the Amazon access key.secretAccessKey
- the Amazon secret access key.region
- the Amazon S3 region. (If you don't specify a region, the bucket will be created in US Standard.)endpoint
- the S3 endpoint URL. (If you don't specify an endpoint, the bucket will be created at Amazon S3 using the provided region if any)setACL
- defaults to true, if set to false, not acl is set for the objectsACL
- the ACL to set if setACL is not false, defaults to public-read
At the moment, Hapi doesn't support caching of non-JSONifiable responses (like Streams or Buffers, see #1948). If you want to use catbox-s3 for binary data, you have to handle it manually in your request handler:
var Catbox = require('catbox');
// On hapi server initialization:
// 1) Create a new catbox client instance
var cache = new Catbox.Client(require('catbox-s3'), {
accessKeyId : /* ... */,
secretAccessKey : /* ... */,
region : /* ... (optional) */,
bucket : /* ... */
});
// 2) Inititalize the caching
cache.start(function (err) {
if (err) { console.error(err); }
/* ... */
});
// Your route's request handler
var handler = function (request, reply) {
var cacheKey = {
id : /* cache item id */,
segment : /* cache segment name */
};
cache.get(cacheKey, function (err, result) {
if (result) {
return reply(result.item).type(/* response content type */);
}
yourBusinessLogic(function (err, data) {
cache.set(cacheKey, data, /* expiration in ms */, function (err) {
/* ... */
});
reply(result.item).type(/* response content type */);
});
});
};
In order to run the tests, set the aforementioned options as environment variables:
S3_ACCESS_KEY=<YOURKEY> S3_SECRET_KEY=<YOURSECRET> S3_REGION=<REGION> S3_BUCKET=<YOURBUCKET> npm test
FAQs
Amazon S3 adapter for catbox
The npm package catbox-s3 receives a total of 21 weekly downloads. As such, catbox-s3 popularity was classified as not popular.
We found that catbox-s3 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.