🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

couchdb-timestamp-model

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

couchdb-timestamp-model

Data model for CouchDB timestamps

1.0.1
latest
Version published
Weekly downloads
1
-66.67%
Maintainers
1
Weekly downloads
 
Created

couchdb-timestamp-model

Build Status npm version License semantic-release

Data model for CouchDB timestamps

Installation

npm install --save couchdb-timestamp-model

Usage

const timestamp = require('couchdb-timestamp-model')
timestamp.validate({
  createdAt: '1970-01-01T00:00:00.000Z'
})
// => undefined
// undefined means the object validated

See json-clay for general API docs.

timestamp.validate(<json>)

Validate the given json against the schema. Returns undefined if the data is valid, otherwise an array of errors.

timestamp.generate([attributes])

Generates a model with fake data via json-schema-faker. If an attributes object is provided, its properties will be used instead of faked values.

CLI

A handy command line tool for creating test data:

$ couchdb-timestamp-model --updatedAt "1970-01-01T00:00:00.000Z"
{
  "createdAt": "3175-08-28T09:59:11.646Z",
  "updatedAt": "1970-01-01T00:00:00.000Z"
}

Contributors

© 2016 Tom Vincent tom@field.partners

License

Released under the Apache-2.0 license.

FAQs

Package last updated on 10 Nov 2016

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