Home

Awesome

Klass

Light and fast Class implementation for JavaScript, no fancy stuff or wrapped methods. However it has a .parent method.

This is a bit experimenting, so don't expect too much ;)

Should work in Node.js too.

Tested

As much as is in Klass.html and Klass-node.js, so not much. Also only in Chrome and Node

Mixins

Other Classes

Example

var myClass = new Klass(parent, methods, mixin1, mixin2, ...);

Methods

Extending Classes

// Parent Class
var DarthVader = new Klass(null, {
	init: function(){
	},
	fight: function(arg1, arg2, arg3){ … }
});

// Child
var Luke = new Klass(DarthVader, {
	fight: function(){
		return this.parent('fight', [arg1, arg2, arg3]);
	}
});

Notes

Most stuff is pretty directly taken from MooTools. Use that if you want something stable, it's FTW!