All Projects → talyssonoc → Structure

talyssonoc / Structure

Licence: mit
A simple schema/attributes library built on top of modern JavaScript

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Structure

Skema
🛰 Skema provides a handy & composable way to validate / transform / purify the input data.
Stars: ✭ 359 (+22.95%)
Mutual labels:  schema, validation, model
Framework
Strongly-typed JavaScript object with support for validation and error handling.
Stars: ✭ 136 (-53.42%)
Mutual labels:  schema, validation, model
Meteor Astronomy
Model layer for Meteor
Stars: ✭ 608 (+108.22%)
Mutual labels:  schema, validation, model
Awesome Python Models
A curated list of awesome Python libraries, which implement models, schemas, serializers/deserializers, ODM's/ORM's, Active Records or similar patterns.
Stars: ✭ 124 (-57.53%)
Mutual labels:  schema, validation, model
Vue Rawmodel
RawModel.js plugin for Vue.js v2. Form validation has never been easier!
Stars: ✭ 79 (-72.95%)
Mutual labels:  schema, validation, model
Node Convict
Featureful configuration management library for Node.js
Stars: ✭ 1,855 (+535.27%)
Mutual labels:  schema, validation
Nope Validator
A small, simple and fast JS validator. Like, wow thats fast. 🚀
Stars: ✭ 142 (-51.37%)
Mutual labels:  schema, validation
Joiful
TypeScript Declarative Validation for Joi
Stars: ✭ 177 (-39.38%)
Mutual labels:  schema, validation
Schematics
Project documentation: https://schematics.readthedocs.io/en/latest/
Stars: ✭ 2,461 (+742.81%)
Mutual labels:  schema, validation
Rdfunit
An RDF Unit Testing Suite
Stars: ✭ 117 (-59.93%)
Mutual labels:  schema, validation
Trilogy
TypeScript SQLite layer with support for both native C++ & pure JavaScript drivers.
Stars: ✭ 195 (-33.22%)
Mutual labels:  schema, model
Password Validator
Validates password according to flexible and intuitive specification
Stars: ✭ 224 (-23.29%)
Mutual labels:  schema, validation
Pandasschema
A validation library for Pandas data frames using user-friendly schemas
Stars: ✭ 135 (-53.77%)
Mutual labels:  schema, validation
Schema Utils
Options Validation
Stars: ✭ 162 (-44.52%)
Mutual labels:  schema, validation
modelsafe
A type-safe data modelling library for TypeScript
Stars: ✭ 13 (-95.55%)
Mutual labels:  schema, model
Computed Types
🦩 Joi like validations for TypeScript
Stars: ✭ 197 (-32.53%)
Mutual labels:  schema, validation
godmt
Tool that can parse Go files into an abstract syntax tree and translate it to several programming languages.
Stars: ✭ 42 (-85.62%)
Mutual labels:  schema, model
pyvaru
Rule based data validation library for python 3.
Stars: ✭ 17 (-94.18%)
Mutual labels:  validation, model
openapi-schema-validator
OpenAPI schema validator for Python
Stars: ✭ 35 (-88.01%)
Mutual labels:  schema, validation
System Runtime
A JavaScript library that runs systems
Stars: ✭ 83 (-71.58%)
Mutual labels:  schema, model

A simple schema/attributes library built on top of modern JavaScript

Structure provides a simple interface which allows you to add attributes to your classes based on a schema, with validations and type coercion.

Packages

Documentation

Example Structure usage

For each attribute on your schema, a getter and a setter will be created into the given class. It'll also auto-assign those attributes passed to the constructor.

const { attributes } = require('structure');

const User = attributes({
  name: String,
  age: {
    type: Number,
    default: 18,
  },
  birthday: Date,
})(
  class User {
    greet() {
      return `Hello ${this.name}`;
    }
  }
);

const user = new User({
  name: 'John Foo',
});

user.name; // 'John Foo'
user.greet(); // 'Hello John Foo'

Contributing

LICENSE

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].