New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

extend-class

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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.

latest
Source
npmnpm
Version
1.0.4
Version published
Weekly downloads
10
-23.08%
Maintainers
1
Weekly downloads
 
Created
Source

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.

  • Uses prototypal inheritance
  • The instanceof operator works
  • If present, a constructor named construct is called

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!'
    }

});

Keywords

class

FAQs

Package last updated on 09 May 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts