{"id":23379072,"url":"https://github.com/colevoss/modelo","last_synced_at":"2025-04-08T05:50:26.275Z","repository":{"id":22497694,"uuid":"25837193","full_name":"colevoss/modelo","owner":"colevoss","description":"Easy to use models for web apps","archived":false,"fork":false,"pushed_at":"2014-10-28T02:26:19.000Z","size":164,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-14T04:18:09.452Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/colevoss.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-27T20:15:29.000Z","updated_at":"2014-10-27T20:16:33.000Z","dependencies_parsed_at":"2022-08-21T06:00:52.355Z","dependency_job_id":null,"html_url":"https://github.com/colevoss/modelo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colevoss%2Fmodelo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colevoss%2Fmodelo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colevoss%2Fmodelo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colevoss%2Fmodelo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/colevoss","download_url":"https://codeload.github.com/colevoss/modelo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247785942,"owners_count":20995644,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-21T19:16:31.941Z","updated_at":"2025-04-08T05:50:26.248Z","avatar_url":"https://github.com/colevoss.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Modelo\n\nEasy to use js models for web apps\n\n## About\n\nA JavaScript library by Cole Voss.\n\n## Installation\n\nUsing Bower:\n\n    bower install modelo\n\nOr grab the [source](https://github.com/colevoss/modelo/dist/modelo.js) ([minified](https://github.com/colevoss/modelo/dist/modelo.min.js)).\n\n## Usage\n\nBasic usage is as follows:\n\n```javascript\nvar Person = Modelo.extend({\n  constructor: function(data) {\n    this.base(data); // required to call parent class constructor\n  },\n\n  route: '/people/:id/:name/:occupation',\n\n  template: '\u003cdiv class=\"this is a class\" id=\"id-thing\" data-something-else\u003e\u003cspan\u003eHEY THERE\u003c/span\u003e\u003c/div\u003e',\n\n  beforeGet: function(data) {\n    console.log(data); // This happens before a property is gotten\n  },\n\n  beforeSet: function(data) {\n    console.log(data); // This happens before a property is set\n  },\n\n  afterSet: function(data) {\n    console.log(data); // This happens after a property is set\n  },\n\n  // These validate the value of each property to the the following conditions\n  validations: {\n    name: {\n      type: 'string',\n      match: /^C/,\n      fail: function(err) {\n        console.log(err);\n      }\n    },\n\n    occupation: {\n      type: 'string',\n      fail: function(err) {\n        console.log(err);\n      }\n    }\n  }\n\n});\n\ncole = new Person({id: 1, name: 'Cole', occupation: 'Code Ninja'});\n```\n\nFor advanced usage, see the documentation.\n\n## Documentation\n\nStart with `docs/MAIN.md`.\n\n## Contributing\n\nWe'll check out your contribution if you:\n\n* Provide a comprehensive suite of tests for your fork.\n* Have a clear and documented rationale for your changes.\n* Package these up in a pull request.\n\nWe'll do our best to help you out with any contribution issues you may have.\n\n## License\n\nMIT. See `LICENSE.txt` in this directory.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolevoss%2Fmodelo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcolevoss%2Fmodelo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolevoss%2Fmodelo/lists"}