Socket
Book a DemoInstallSign in
Socket

model-schema

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

model-schema

A plugin that creates a model's attributes from a schema.

latest
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

model-schema

A plugin that creates a model's attributes from a schema.

Installation

$ component install segmentio/model-schema
$ npm install model-schema

Example

var model = require('model');
var schema = require('model-schema');

var json = {
  id: {
    type: 'string',
    required: true,
    validators: [Function, Function]
  },
  name: {
    type: 'string',
    validators: [Function]
  }
};

var User = model()
  .use(schema(json));

API

schema(json)

Return the plugin function for a given json schema.

FAQs

Package last updated on 31 Mar 2014

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