Socket
Socket
Sign inDemoInstall

aws-client

Package Overview
Dependencies
167
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    aws-client

Minimalist Node.js client for AWS services


Version published
Maintainers
1
Created

Readme

Source

aws-client

Minimalist Node.js client for AWS services

Currently Supports:

  • DynamoDB (get, batchGet, put, batchPut, query) - DynamoClient
  • SNS (publish) - SNSClient

Installation

npm install aws-client

If you are using any v1 functions (i.e. function name does not end in v2), then you must also install aws-sdk:

npm install aws-sdk

aws-client v2 functions do not require any additional imports as this package imports the required modular packages (new AWS SDK v3 feature). Eventually all v1 packages will migrate to aws-client v2

Import

You can import one or many clients depending on what you need:

ES6 Import:

import { DynamoClient, SNSClient } from 'aws-client'

CommonJS:

const { DynamoClient, SNSClient } = require('aws-client')

Usage

const client = new DynamoClient({
  region: 'eu-west-1',
  tableName: 'users-prod'
})

const getUser = async (id) => {
  const data = await client.get({ id })
  console.log(data)
}

getUser('fred')

If there is a DynamoDB table called users-prod in your AWS account containing an item with the primary key (id) of 'fred', the above code will print it to the console.

Keywords

FAQs

Last updated on 05 Jul 2023

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc