aws-sdk-agent
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i aws-sdk-agent

Weekly Downloads

4

Version

1.1.0

License

MIT

Unpacked Size

12.7 kB

Total Files

8

Last publish

Collaborators

  • hideokamoto