@rapidom/schema
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.0 • Public • Published

    RapidOM Schema

    TypeScript ready schema validator

    Build Status Coverage Status NPM Version npm bundle size (minified) npm bundle size (minified + gzip) NPM Monthly Downloads NPM Total Downloads Dependencies Status Open Issues Pull Requests License

    Table of Content

    Getting Started

    Installation

    NPM / GitHub Packages:

    npm i @rapidom/schema

    Yarn:

    yarn add @rapidom/schema

    Usage

    import Schema from "@rapidom/schema";
    
    const schema = {
      username: Schema.string()
        .alphanum()
        .required(),
      name: Schema.object().keys({
        first: Schema.string()
          .min(3)
          .required(),
        last: Schema.string().min(3),
      }).required(),
      datetime: Schema.date().default(Date.now),
    };
    
    try {
      const result = Schema.object().keys(schema).validate(value);
    } catch (error) {
      // your error handler
    }

    for more details read the documents

    Authors

    See also the list of contributors who participated in this project.

    Versioning

    We use SemVer for versioning. For the versions available, see the releases.

    License

    This project is licensed under the MIT License - see the LICENSE file for details

    Install

    npm i @rapidom/schema

    DownloadsWeekly Downloads

    93

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    135 kB

    Total Files

    108

    Last publish

    Collaborators

    • ardalanamini