Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
dynamo-butter
Advanced tools
If you are going to use the AWS "Thick" Client, you might as well add butter
dynamo-butter is inspired by the AWS Dynamo Thin Client. It uses util.promsify
of the client methods, adds the same Quality-of-Life methods (e.g. batchGetAll
), and sets up the keep-alive
agent by default.
Since AWS Lambda provides aws-sdk
by default, this library does not declare a dependency on it. However, it is required. If you need to run unit tests, make sure to add aws-sdk
to your own devDepdendencies
.
npm i dynamo-butter
const Butter = require('dynamo-butter')
const client = Butter.up({ region: 'us-west-2' })
const data = await client.scanAll({ TableName: 'some-table' })
dynamo-butter exports one method: up()
. Which can be used in two different modes. The first parameter depends on the mode, while the second parameter provides config options to dynamo-butter.
Uses the recommended defaults, with a configuration object that is passed to the DynamoDB DocumentClient constructor.
const Butter = require('dynamo-butter')
const client = Butter.up({
region: 'us-west-2',
endpoint: IS_TESTING && TEST_SERVER_ENDPOINT,
convertEmptyValues: true // optional, defaults to true
})
If you want to configure the DynamoDB DocumentClient yourself, you can pass it to butter instead of a config object.
const Butter = require('dynamo-butter')
const Dynamo = require('aws-sdk/clients/dynamodb')
const dynamo = new Dynamo.DocumentClient({
convertEmptyValues,
service: new Dynamo({
region,
endpoint
})
})
const client = Butter.up(dynamo)
The second parameter to Butter.up()
is an options object for butter. It is optional, and each property is optional and defaults to true.
false
to not add batchWriteAll
batchGetAll
queryAll
and scanAll
to the client.keepAlive
on the configured agent.const client = Butter.up({
region: 'us-west-2',
endpoint: IS_TESTING && TEST_SERVER_ENDPOINT,
convertEmptyValues: true // optional, defaults to true
}, {
includeAutoPagingMethods: true,
useKeepAlive: true
}
[1.2.0] - 2020-10-07
Passthrough for other dynamo options (e.g. credentials
)
FAQs
A dynamo client enhancer
We found that dynamo-butter 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.