aws-sdk-agent
v1.1.0
Published
Create AWS SDK class with HTTP keep-alive
Downloads
3
Readme
AWS SDK with enable HTTP keep-alive
This is the AWS SDK wrapper with HTTP keep-alive Ref: https://medium.com/theburningmonk-com/lambda-optimization-tip-enable-http-keep-alive-5c55810f70fe
Getting started
$ npm i -S aws-sdk-agent
Usage
const createAWSAgent = require('aws-sdk-agent')
const AWS = createAWSAgent()
const client = new AWS.DynamoDB.DocumentClient()
client.scan({
TableName: 'MyTable'
}).promise()
import createAWSAgent from 'aws-sdk-agent'
const AWS = createAWSAgent()
const client = new AWS.DynamoDB.DocumentClient()
client.scan({
TableName: 'MyTable'
}).promise()
with option
You can overwrite agent option.
const AWS = createAWSAgent({
keepAlive: true,
maxSockets: 50,
rejectUnauthorized: true
})
Parameter can see here. https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/node/https.d.ts#L14-L17