coop

Co-operative multiple inheritance for JavaScript

npm install coop
36 downloads in the last month

Co-Op provides Pythonic cooperative multiple inheritance to Javascript and Node.js.

Build Status

Installation

npm install coop

Usage

Creating a class is similar to Mootools:

var Class = require('coop').Class;
var MyClass = new Class({
  initialize: function(me) {
    this.me = me;
  }
});

Inheritance

...is a little different from Mootools. But orders of magnitude more powerful.

var MySubClass = new Class([MyClass, MyOtherClass], {
  initialize: function (me) {
    this.super(me);
  }
})
npm loves you