{"library":"o3","title":"Ozone (o3) JavaScript Class Framework","description":"The `o3` package, also known as Ozone, is a JavaScript class framework designed to bring enhanced object-oriented programming capabilities to ES5 environments. Released as version 1.0.3, its last significant update was over five years ago, indicating it is no longer actively maintained and can be considered abandoned. It aimed to provide class-like inheritance and structure at a time when native ES6 classes were not widely supported, offering an alternative to transpilers like Babel or TypeScript for class definitions. The framework requires an ES5-compatible environment, specifically relying on `Object.create` and ES5 property enumeration features. Its primary differentiator was enabling robust class inheritance in older runtimes without needing a build step. Due to its age and the universal adoption of native ES6 classes, its utility in modern JavaScript development is minimal.","language":"javascript","status":"abandoned","last_verified":"Sun Apr 19","install":{"commands":["npm install o3"],"cli":null},"imports":["const o3 = require(\"o3\");","const { Class } = require(\"o3\");","const Class = o3.Class; // after const o3 = require('o3');"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const o3 = require(\"o3\");\nconst Class = o3.Class;\n\n// Define a base class inheriting from Object\nconst BasePerson = Class(Object, {\n    prototype: {\n        // Constructor function\n        constructor: function BasePerson(name) {\n            this.name = name;\n        },\n        // A method\n        sayHello: function() {\n            console.log(`Hello, my name is ${this.name}.`);\n        }\n    }\n});\n\n// Define a derived class using the inherited extend method\nconst Employee = BasePerson.extend({\n    prototype: {\n        constructor: function Employee(name, position) {\n            // Call the super constructor\n            BasePerson.prototype.constructor.call(this, name);\n            this.position = position;\n        },\n        // Override or add new methods\n        sayHello: function() {\n            console.log(`Hello, I'm ${this.name} and I'm a ${this.position}.`);\n        },\n        work: function() {\n            console.log(`${this.name} is working.`);\n        }\n    }\n});\n\nconst person = new BasePerson(\"Alice\");\nperson.sayHello();\n\nconst employee = new Employee(\"Bob\", \"Software Engineer\");\nemployee.sayHello();\nemployee.work();","lang":"javascript","description":"Demonstrates defining a base class and an inheriting class using o3's `Class` and `extend` methods, showcasing object instantiation and method calls.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}