Skip to content
Alan Berdinelli edited this page Dec 16, 2022 · 20 revisions

Schemy is a extremely simple, lightweight yet full featured schema validation library.

⬇ Install

Install using npm or yarn:

  • npm install --save schemy
  • yarn add schemy

👨🏼‍💻 Usage

To define the schema just create a new Schemy instance. Check the documentation for more examples.

const userSchema = new Schemy({
    email: { 
        type: String,
        required: true 
    },
    birthYear: {
        type: Number,
        min: 1980,
        max: 2010
    },
    id: {
        type: String
    }
});

🧩 Plugins

Schemy functionality can be extended with plugin. You can check our available plugins or find out how to create your own.

Plugin lists Develop
View all available plugins Using plugins
View all translation plugins Creating your plugin

📚 Documentation

This is the most up to date documentation source for Schemy.

Validation Methods Options Supported Types Built-in Validations
Synchronous validation Required Date uuid/v1
Asynchronous validation Strict String uuid/v4
Promises Min Regex
Max Number
Custom validations Array
Function



Clone this wiki locally