0.3.3 • Published 4 years ago

dyno-item-size v0.3.3

Weekly downloads
2,390
License
MIT
Repository
-
Last release
4 years ago

CircleCI

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);
// => 32

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.

0.3.2

4 years ago

0.3.3

4 years ago

0.3.1

5 years ago

0.3.0

6 years ago

0.2.0

7 years ago

0.1.0

8 years ago