New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@kenzable/dyno-item-size

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kenzable/dyno-item-size

compute the size of an item the same way dynamodb does

  • 0.4.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

Dyno Item Size

This is a simple utility to calculate the size of an item as DynamoDB would. The goal of this project is to be accurate within a byte so that you can make optimized requests to DynamoDB.

Usage

var dynoItemSize = require('dyno-item-size');
var item = {
  'string': 'string',
  'number': 27,
  'buffer': new Buffer('buffer', 'utf8')
};
var size = dynoItemSize(item);
console.log(size);
// => 31

API

dynoItemSize comes with a two helper functions to translate the size of an object into it's read or write capacity cost.

dynoItemSize(object)

Takes an object like the one shown in usage and returns the size in bytes.

dynoItemSize.read(object)

Takes an object like the one shown in usage and returns the read capacity cost.

dynoItemSize.write(object)

Takes an object like the one shown in usage and returns the write capacity cost.

Resources

This module has been implemented by reading a few resources.

FAQs

Package last updated on 20 Jun 2019

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

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc