girders
v0.1.2
Published
Generic, simple and sensible data management for JavaScript
Downloads
3
Readme
Girders
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`);