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

dynamo-schema

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

dynamo-schema

Simple Schema validation for DynamoDB style schemas

0.0.2
latest
Source
npm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

dynamo-schema is a sanitization and validation module for Amazon DynamoDB data models. It is meant as an item schema and is meant to be used in conjunction with the low level methods provided by dynamo drivers such as this one .

Example

var Schema = require('dynamo-schema');

schema = new Schema({
  name: 'S',
  created_at: 'N',
  colors: 'SS',
  dates: 'NN'
});

var output = schema.sanitize({
  name: 'Andrew',
  created_at: Date.now(),
  colors: ['red', 'blue'],
  dates: [Date.now()+1000, Date.now()+2000]
});

var new_object = schema.parse(output);

// new object should be identical to the original object passed into sanitize

Install

npm install dynamo-schema

Run Tests

Ensure you have mocha installed. npm install mocha.

mocha test/test.js --reporter spec

TODO

  • Per Attribute bignum support
  • More types to use in schema definitions
    • enum
    • dates
    • regex
  • More tests
  • API docs

FAQs

Package last updated on 03 Feb 2012

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