You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@aws-sdk/util-dynamodb

Package Overview
Dependencies
2
Maintainers
5
Versions
359
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/util-dynamodb

[![NPM version](https://img.shields.io/npm/v/@aws-sdk/util-dynamodb/latest.svg)](https://www.npmjs.com/package/@aws-sdk/util-dynamodb) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/util-dynamodb.svg)](https://www.npmjs.com/package/@aws-sdk/util


Version published
Maintainers
5
Created

Package description

What is @aws-sdk/util-dynamodb?

The @aws-sdk/util-dynamodb package is part of the AWS SDK for JavaScript v3. It provides utility functions to serialize JavaScript objects into the DynamoDB record format and deserialize DynamoDB records into JavaScript objects. This is particularly useful when working with AWS DynamoDB, allowing developers to easily convert data between the formats used by their applications and the database.

What are @aws-sdk/util-dynamodb's main functionalities?

Marshall

Converts a JavaScript object into a DynamoDB record format. Useful for preparing data to be sent to DynamoDB.

const { marshall } = require('@aws-sdk/util-dynamodb');
const item = { id: 1, content: 'Hello World' };
const marshalledItem = marshall(item);
console.log(marshalledItem);

Unmarshall

Converts a DynamoDB record into a JavaScript object. This is useful when retrieving data from DynamoDB and using it within a JavaScript application.

const { unmarshall } = require('@aws-sdk/util-dynamodb');
const dynamoRecord = { id: { N: '1' }, content: { S: 'Hello World' } };
const item = unmarshall(dynamoRecord);
console.log(item);

ConvertEmptyValues

Allows the conversion of empty values (like null) to a specific DynamoDB type when marshalling. This helps in maintaining data consistency when storing in DynamoDB.

const { marshall } = require('@aws-sdk/util-dynamodb');
const item = { id: 1, content: null };
const options = { convertEmptyValues: true };
const marshalledItem = marshall(item, options);
console.log(marshalledItem);

Other packages similar to @aws-sdk/util-dynamodb

Changelog

Source

3.564.0 (2024-04-26)

Features

  • client-codepipeline: Add ability to manually and automatically roll back a pipeline stage to a previously successful execution. (27a9b33)
  • client-cognito-identity-provider: Add LimitExceededException to SignUp errors (633da5a)
  • client-connectcampaigns: This release adds support for specifying if Answering Machine should wait for prompt sound. (3235950)
  • client-marketplace-entitlement-service: Releasing minor endpoint updates. (231317d)
  • client-oam: This release introduces support for Source Accounts to define which Metrics and Logs to share with the Monitoring Account (28b5215)
  • client-rds: SupportsLimitlessDatabase field added to describe-db-engine-versions to indicate whether the DB engine version supports Aurora Limitless Database. (dcebb69)
  • client-support: Releasing minor endpoint updates. (354980a)
  • clients: update client endpoints as of 2024-04-26 (7024e2e)

Readme

Source

@aws-sdk/util-dynamodb

NPM version NPM downloads

This package provides utilities to be used with @aws-sdk/client-dynamodb

If you are looking for DynamoDB Document client, please check @aws-sdk/lib-dynamodb which automatically performs the necessary marshalling and unmarshalling.

Convert JavaScript object into DynamoDB Record

const { DynamoDB } = require("@aws-sdk/client-dynamodb");
const { marshall } = require("@aws-sdk/util-dynamodb");

const client = new DynamoDB(clientParams);
const params = {
  TableName: "Table",
  Item: marshall({
    HashKey: "hashKey",
    NumAttribute: 1,
    BoolAttribute: true,
    ListAttribute: [1, "two", false],
    MapAttribute: { foo: "bar" },
    NullAttribute: null,
  }),
};

await client.putItem(params);

Convert DynamoDB Record into JavaScript object

const { DynamoDB } = require("@aws-sdk/client-dynamodb");
const { marshall, unmarshall } = require("@aws-sdk/util-dynamodb");

const client = new DynamoDB(clientParams);
const params = {
  TableName: "Table",
  Key: marshall({
    HashKey: "hashKey",
  }),
};

const { Item } = await client.getItem(params);
unmarshall(Item);

FAQs

Package last updated on 26 Apr 2024

Did you know?

Socket

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
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc