Inherit
This module provides some syntax sugar for "class" declarations, constructors, mixins, "super" calls and static members.
Getting Started
In Node.js
You can install using Node Package Manager (npm):
npm install inherit
In Browsers
It also supports RequireJS module format and YM module format.
Module has been tested in IE6+, Mozilla Firefox 3+, Chrome 5+, Safari 5+, Opera 10+.
Specification
Creating a base class
Function ;
Creating a base class with static properties
Function ;
Creating a derived class
Function ;
Creating a derived class with mixins
Function ;
Example
var inherit = ; // base "class"var A = ; // inherited "class" from Avar B = ; // mixin Mvar M = ; // inherited "class" from A with mixin Mvar C = ; var instanceOfB = 'property'; instanceOfB; // returns 'property of instanceB'instanceOfB; // returns 'AB'B; // returns 'staticA of staticB' var instanceOfC = ;instanceOfC // returns "mixed property from C"