Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Helper functions for prototypical inheritance in JavaScript.
Use the source code and JSDoc comments as documentation, here's a quick example to get you started.
const heir = require('heir')
// Create the base class.
function Base() {}
// Add a method.
Base.prototype.foo = function () {
return 'Base#foo'
}
// Create a sub class which inherits from base.
function Sub() {}
heir.inherit(Sub, Base)
// Mix in some functionality enhancing objects.
heir.mixin(Sub, events)
heir.mixin(Sub, pooling)
// Change the original method.
Sub.prototype.foo = function () {
return [
'Sub#foo',
Sub._super.foo.call(this)
].join(', ')
}
// Create an instance of Sub and call it's method.
const s = new Sub()
s.foo() // Returns "Sub#foo, Base#foo"
This project is given to you under the unlicense, as documented in the UNLICENSE
file in this directory. Enjoy.
v4.0.0
module.exports
and require
is good enough and can be compiled out.const
over var
, if you really need something to target an old browser etc use a transpiler or v3.0.0.FAQs
Helper functions for prototypical inheritance
The npm package heir receives a total of 17 weekly downloads. As such, heir popularity was classified as not popular.
We found that heir demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.