
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Simple OOP library. Works fast like native inheritance (see benchmarks). The library does not contain any super or analogs because it contaminates the prototype and a bad influence on performance.
##Install For bower users:
bower install subtype
For node.js users:
npm install subtypejs
Also you can download uncompressed and compressed version from GitHub.
##Usage In a browser:
<script src="path/to/subtype.js"></script>
In an AMD loader:
define(['subtype'], function (Subtype) {
// code...
});
In node.js:
var Subtype = require('subtypejs');
// code...
And then:
var Human = Subtype.extend({
constructor: function (name) {
this.name = name;
},
say: function (words) {
return this.name + ': ' + words;
}
});
var Actor = Human.extend({
say: function (words) {
// explicit call the super method
return 'actor ' + Human.prototype.say.call(this, words);
}
});
var human = new Human('Robert');
console.log(human.say('Hi!')); // => "Robert: Hi!"
var actor = new Actor('Jeremy');
console.log(actor.say('Hello!')); // => "actor Jeremy: Hello!"
console.log(
human instanceof Human &&
human instanceof Subtype &&
actor instanceof Actor &&
actor instanceof Human &&
actor instanceof Subtype
); // => true
console.log(
Subtype === Subtype.prototype.constructor &&
Human === Human.prototype.constructor &&
Actor === Actor.prototype.constructor
); // => true
FAQs
Minimalistic OOP library
We found that subtypejs 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.