waterline-joi

1.1.5 • Public • Published

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)

Readme

Keywords

Package Sidebar

Install

npm i waterline-joi

Weekly Downloads

2

Version

1.1.5

License

MIT

Last publish

Collaborators

  • newworldcode