Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

static-extend

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

static-extend

Adds a static `extend` method to a class, to simplify inheritance. Extends the static properties, prototype properties, and descriptors from a `Parent` constructor onto `Child` constructors.

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is static-extend?

The static-extend npm package is used to easily extend the static properties and methods of a class. This is particularly useful in object-oriented programming where you might want to inherit or share static properties among multiple classes without affecting their instances directly.

What are static-extend's main functionalities?

Extending static methods and properties

This feature allows you to extend static methods and properties from one constructor function (or class) to another. In the provided code, the Child constructor inherits the static method 'foo' from the Parent constructor.

const staticExtend = require('static-extend');

function Parent() {}
Parent.foo = function() { return 'foo'; };

function Child() {}
staticExtend(Child, Parent);

console.log(Child.foo()); // Outputs: 'foo'

Other packages similar to static-extend

Keywords

FAQs

Package last updated on 09 Jun 2016

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc