Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
bloody-class
Advanced tools
[![browser support](https://ci.testling.com/bloodyowl/class.png)](https://ci.testling.com/bloodyowl/class)
$ npm install bloody-class
With component(1):
$ component install bloodyowl/class
var klass = require("class")
Classes are objects that contain inherits for instances. You can extend and create instances of an existing class. Classes are based on prototypal inheritance, that way, you can easily update all subclasses and instances from one of their parent class.
klass.extend([object])
-> newClass
Creates a new class that inherits from klass
. Optionaly takes an object
arguments that extends the newClass
as owned properties.
klass.create([args …])
-> newInstance
Creates a new instance that inherits from klass
. Its arguments are passed to klass.constructor
which is called if klass
owns a constructor
method.
instance.destroy([args …])
Removes all the internal references to instance
, as in parent.instances
for instance. Its arguments are passed to klass.destructor
which is called if klass
owns a destructor
method.
// create a class
var myClass = klass.extend({
// constructor is the method called when an instance is created
constructor : function(args/* …*/){
// this -> instance
// args … -> arguments passed through the `.create` method
},
destructor : function(){
// this -> instance
// args … -> arguments passed through the `.destroy` method
}
})
// myClass has a "_klass" property with a uniq integer
myClass._klass // -> integer
// create an instance
var myInstance = myClass.create()
// myInstance has a "_id" property with a uniq integer (relative to its parent class)
myInstance._id // -> integer
// instance is in myClass._instances and myInstance._instances
each(myClass._instances, console.log, console)
// > logs [myInstance, "0", myClass._instances]
// destroy an instance
myInstance.destroy()
// instance is now removed from myClass._instances
each(myClass._instances, console.log, console)
// > doesn't log anything
// and wipe it out
myInstance = null
FAQs
[![Build Status](https://travis-ci.org/bloodyowl/class.svg)](https://travis-ci.org/bloodyowl/class)
The npm package bloody-class receives a total of 3 weekly downloads. As such, bloody-class popularity was classified as not popular.
We found that bloody-class 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.