{"id":22022725,"url":"https://github.com/cj/js-oo","last_synced_at":"2025-05-07T07:22:47.393Z","repository":{"id":936222,"uuid":"709547","full_name":"cj/js-oo","owner":"cj","description":"JavaScript Inheritance -- Super Lightweight, powerful, elegant class based inheritance for js","archived":false,"fork":false,"pushed_at":"2009-12-16T23:34:56.000Z","size":94,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-29T11:13:52.489Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cj.png","metadata":{"files":{"readme":"Readme.md","changelog":"History.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-06-08T14:25:29.000Z","updated_at":"2018-12-18T21:16:05.000Z","dependencies_parsed_at":"2022-08-16T11:31:07.983Z","dependency_job_id":null,"html_url":"https://github.com/cj/js-oo","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cj%2Fjs-oo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cj%2Fjs-oo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cj%2Fjs-oo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cj%2Fjs-oo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cj","download_url":"https://codeload.github.com/cj/js-oo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227284741,"owners_count":17758447,"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-11-30T06:22:35.308Z","updated_at":"2024-11-30T06:22:35.818Z","avatar_url":"https://github.com/cj.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# JavaScript OO\n\nSuper lightweight Object Oriented library for JavaScript.\n\n## Examples\n\nCreate a simple class, with no properties or methods:\n\n    User = Class()\n    // or Class.extend()\n    \nCreate a class containing both properties and methods:\n\n    User = Class({\n      type: 'user',\n      init: function(name) {\n        this.name = name\n      }\n    })\n    \nCreate an instance of the \"User\" class above:\n\n    tj = new User('tj')\n    tj.type\n    // =\u003e \"user\"\n    tj.name \n    // =\u003e \"tj\"\n    \nSubclass the User class we created:\n\n    Admin = User.extend({\n      type: 'admin'\n    })\n\n    tj = new Admin('tj')\n    tj.type\n    // =\u003e \"admin\"\n    tj.name \n    // =\u003e \"tj\"\n    \nReference superclass methods using __super__:\n\n    Admin = User.extend({\n      init: function(name, age) {\n        this.__super__(name)\n        this.age = age\n      },\n      \n      toString: function() {\n        return '\u003cAdmin name=\"' + this.name + '\" age=' + this.age + '\u003e'\n      }\n    })\n    \n    tj = new Admin('tj', 22)\n    tj.toString()\n    // =\u003e \"\u003cAdmin name=\\\"tj\\\" age=22\u003e\"\n      \nInclude more methods:\n\n    Admin.include({\n      says: function(){\n        return 'Im an admin!'\n      }\n    })\n    \nOr include some mixins (objects):\n\n    Enumerable = { ... }\n    Comparable = { ... }\n\n    Animal = Class({\n      include: [Enumerable, Comparable]\n    })\n    \nOr a single mixin:\n  \n    Animal = Class({\n      include: Enumerable\n    })\n    \nExtend singleton prototype with methods:\n\n    User = Class({\n      extend: {\n        path: '/users'\n      }\n    })\n    \n    User.path\n    // =\u003e '/users'\n    \nOr using \"mixins\":\n\n    User = Class({\n      extend: Foo\n    })\n    \nOr using several \"mixins\":\n\n    User = Class({\n      extend: [Foo, Bar]\n    })\n    \n## License \n\n(The MIT License)\n\nCopyright (c) 2009 TJ Holowaychuk \u003ctj@vision-media.ca\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcj%2Fjs-oo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcj%2Fjs-oo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcj%2Fjs-oo/lists"}