1.0.11 • Published 4 years ago

@zcorky/schema v1.0.11

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

schema

NPM version NPM quality Coverage Status Dependencies Build Status Known Vulnerabilities NPM download license issues

Object schema description language and validator for JavaScript objects, inspired by hapijs/joi and hh54188/schemaor. It is written fully with Typescript.

  • 🕒 Familiar joi API & patterns
  • 💪 Node and Browser Support
  • 🔥 Chainable
  • :sparkle: TypeScript
  • 🌐 I18n support (WIP)
  • 🔌 Plugin System (WIP)

Install

$ npm install @zcorky/schema

Usage

import * as Types from '@zcorky/schema';

const user = new Types.object({
  id: new Types.string().require(),
  nickname: new Types.string().require(),
  homepage: new Types.string(),
  age: new Types.number(),
  active: new Types.boolean(),
});

const validatedData = Types.validate(user, {
  id: '1',
  nickname: 'whatwewant',
  active: true,
});

API

Relatived

  • joi - Object schema description language and validator for JavaScript objects..
  • schemaor
  • ajv -The fastest JSON Schema validator for Node.js and browser.

License

MIT © Moeover

1.0.11

4 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.0.1

5 years ago