node package manager
It’s your turn. Help us improve JavaScript. Take the 2017 JavaScript Ecosystem Survey »



Simple extend is a JavaScript constructor inheritance utility. The utility can be used in both browser environments and node environments. It strives to use as much of the standard JavaScript functionality as possible.


To use Simple extend with node.js simply use npm:

$ npm install node-simple-extend

To use Simple extend in a browser environment, simply include the simple-extend.js file in a script tag.


To use Simple extend you need to do two things:

  1. Run the method extend with the first argument as the constructor you want to extend and the second argument as the constructor you like to inherit from.
  2. Inside the child constructor, call the parent constructor with, argument1, argument2);

Below is a simple usage example:

function Parent() {}
Parent.prototype.swim = function () {
    console.log( + ' is swimming.');

function Child() {;
extend(Child, Parent);

var animal = new Child();

For a bit more involved example, look at the example/example.js file.


The code for this module is released under the MIT license, for more details read the LICENSE file that is provided in this repository.