1.0.4 • Published 9 years ago

extend-class v1.0.4

Weekly downloads
16
License
-
Repository
github
Last release
9 years ago

extend-class

Creates a new class inheriting the methods and properties of a parent class, and copies a new set of methods and properties to the child class.

Note: Large prototype chains can impact performance. Use sparingly.

Install

With npm:

npm install --save extend-class

With componentjs:

component install --save extend-class

Example

var extend = require('extend-class');

...

var Cat = extend(Animal, {

    construct: function() {
        Animal.call(this);
    },

    noise: function() {
        return 'Meeow!'
    }

});