waterline-joi

Blueprint to Joi validation converter.

Showing:

Popularity

Downloads/wk

23

GitHub Stars

3

Maintenance

Last Commit

2yrs ago

Contributors

2

Package

Dependencies

2

Size (min+gzip)

27.7KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Waterline Joi

Build Status Coverage Status

npm i --save waterline-joi

Waterline Blueprint to Joi validation converter.

// Get Waterline.
var Waterline = require('waterline')

// Get the function to convert schemas.
var waterline_to_joi = require("waterline-joi")

// Define your schema.
var schema = {
  attributes: {
    firstName: {
      type: 'string',
      required: true
    },

    lastName: {
      type: 'string',
      required: true
    }
  }
}

// Create a Joi schema.
var joi_schema = waterline_to_joi(schema.attributes)

// Create the user
var User = Waterline.Collection.extend(schema)

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100