node package manager
Love JavaScript? Your insights can make it even better. Take the 2017 JavaScript Ecosystem Survey »


LazyExtendable Build Status

Lazy and unobturisve JavaScript inheritance helper



npm install lazy-extendable


Download and reference via script

<script src="lazy-extendable.js"></script>

Why another inheritance framework?

Proper naming

It's not a Klass, and not even Class. It's just JavaScript inheritance helper and it's called LazyExtendable. If you want to create new extendable type you call new LazyExtendable() or LazyExtendable.create(), not .extend. Want to extend your type? Use YourType.extend().


It doesn't add any own properties to prototype. Want add base or super property to you type? Now you can.


Have a huge type hierarchy and it's all built every time, even when unneeded? Forget it, now certain types will be built only if you use them.

Advanced overriding

It's not necessary to change base types, just override method you need and call any base method you want.

var Woman = new LazyExtendable(function () {
    return {
        say: function () {
            var buffer = [];
            return buffer.join(' ');
        _find: function () {
            return 'Here you are, jerk!';
        _greet: function () {
            return 'Hello my darling.';
        _throwPlate: function () {
            return 'Take this!';
var PoliteWoman = Woman.extend(function (base) {
    return {
        say: function () {
            return base._greet();

Naming again

Now you can name base instance as you want. Like Java? Call base methods via super. Like C#? Call via base. Like LOTR? Call it via gandalfTheGrey.

Advanced IDE autocompletion

You can specify exact type of base type with annotations your IDE understand and get better autocompletion behavior.