
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.
aws-sdk-wrap
Advanced tools
Wrapper around aws-sdk.
When dealing with the aws-sdk a lot, some calls become very repetitive and achieving code coverage becomes tiresome. This wrapper abstracts some of the repetitive logic.
Some examples of repetitive logic are:
.promise()
Install with npm:
$ npm install --save aws-sdk-wrap
Ensure required peer dependencies are available.
const aws = require('aws-sdk-wrap')();
aws
.call('s3:putObject', { /* ... */ })
.then(/* ... */)
.catch(/* ... */);
where the first parameter is the service, the second parameter is the method and the third parameter are the "params" passed into the call.
Services are lazily initialized on first access.
One can access an aws-sdk
service directly by calling e.g. aws.get('s3')
.
The action
is of the format path.to.service:functionName
.
Gets the service from the underlying aws-sdk
and initialize it with the available config iff the service is not initialized yet.
Then calls the function with the passed params
(which needs to contain the appropriate parameters for the function).
The available call options
are detailed below.
Get the service from the underlying aws-sdk
without initializing it. Possible to access nested paths.
Updates the global aws config of the underlying aws-sdk
via AWS.config.update
.
In most cases this should not be necessary to use.
Splits msgs
into groups and calls sqs.SendMessageBatch for every group.
Batch sizes can be modified by the batchSize
option. Failed calls will be retried up to the maxRetries
option.
The available sendMessageBatch options
are detailed below.
Type: Logger
Default: null
Provide logger. E.g. logplease or lambda-rollbar.
When an unexpected error is risen, information is logged using .error(...)
.
Type: Object
Default: {}
AWS Config object used to initialize the service.
This only affects initialized services. To update the global AWS config use updateGlobalConfig
.
Type: list
Default: []
Provide string list of expected AWS error codes. Promise succeeds on expected error with error code as string.
Type: integer
Default: 10
Specify the size of each batch that will be sent. Should never exceed 10.
Type: integer
Default: 10
Number of times to retry any failed requests.
Type: Function
Default: (count) => 30 * (count ** 2)
The length of time the function will wait after each failed request before retrying.
FAQs
Wrapper around aws-sdk
The npm package aws-sdk-wrap receives a total of 157 weekly downloads. As such, aws-sdk-wrap popularity was classified as not popular.
We found that aws-sdk-wrap demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.