Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    schematronpublic

    Yet another boilerplate free schema validation library, Connect/Express middleware included.

    {validate, any, optional} = require 'schematron'
    
    schema = {
      key: any
      count: Number
      isActive: Boolean
      name: optional(String)
    }
    
    data = {
      key: {}
      count: 2
      isActive: false
    }
    
    {errors, data} = validate(schema, data)
    

    Or use Connect/Express middleware

    {validate} = require 'schematron/middleware'
    
    app.get '/search',
      validate(q: String, limit: optional(Number)),
      (req, res) ->
        // access req.validQuery for validated data
    

    Keywords

    none

    install

    npm i schematron

    Downloadsweekly downloads

    0

    version

    0.2.1

    license

    none

    repository

    github.com

    last publish

    collaborators

    • avatar