-
-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Alan Berdinelli edited this page Dec 16, 2022
·
20 revisions
Schemy is a extremely simple, lightweight yet full featured schema validation library.
Install using npm or yarn:
npm install --save schemyyarn add schemy
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
}
});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 |
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 |
Developed with ♥ by Alan Berdinelli.