girders

0.1.2 • Public • Published

Girders

Build Status Coverage Status

A one-stop JavaScript shop for models. Define once, use on both client and server side, with (still to be developed!) easy integration with IndexedDB, GraphQL and REST endpoints.

Written in the latest ECMAScript for maximum readability and simplicity of use.

Quick example

const Girders = require('girders');

class Car extends Girders.Model {
  getSchema() {
    return {
      id: Number,
      name: {type: String, isRequired: true},
      doors: Number
    };
  }

  get url() {
    return `https://example.com/car/${this.username}`;
  }
}

const peugeot309 = new Car({name: 'Peugeot 309', doors: 5});

console.log(`<a href="${peugeot309.url}">${peugeot309.name}</a> has ${peugeot309.doors} doors`);

Readme

Keywords

none

Package Sidebar

Install

npm i girders

Weekly Downloads

0

Version

0.1.2

License

ISC

Last publish

Collaborators

  • gregtyler