Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Use the Coffee-Script extends keyword outside of Coffee-Script. Useful for easily extending existing existing classes, e.g. `require('csextends')(klass, extensions)`, and for providing your module consumers with an easy way to extend your classes, i.e. `B
Use the Coffee-Script extends keyword outside of Coffee-Script. Useful for easily extending existing existing classes, e.g. require('csextends')(klass, extensions)
, and for providing your module consumers with an easy way to extend your classes, i.e. Backbone.Model.extend(extensions)
.
require('csextends')
npm install --save csextends
require('csextends')
npm install --save csextends
//wzrd.in/bundle/csextends@1.0.2
require('csextends')
ender add csextends
// Create a Class
var Person = function(name){
this.name = name
}
Person.prototype.name = 'Unknown'
Person.prototype.hello = function(){
console.log('Hello '+this.name+'!')
}
// Extend the class
var Child = require('csextends')(Person, {
constructor: function(name, mother, father){
this.name = name
this.mother = mother
this.father = father
},
mother: null,
father: null,
heyYaAll: function(){
this.hello()
this.mother.hello()
this.father.hello()
}
})
// Create some people
var eve = new Person('Eve')
var adam = new Person('Adam')
var me = new Child('me', eve, adam)
me.heyYaAll()
// Hello me!
// Hello Eve!
// Hello Adam!
// Is me still a person
console.log(me instanceof Person) // true
// Now let's make this easier for people in the future
Person.prototype.subclass = require('csextends')
// Now, instead of doing:
// var Child = require('csextends')(Person, extensions)
// We can now do:
// var Child = Person.subclass(extensions)
// Which is very useful for module consumers.
// If you use CoffeeScript, you can accomplish the above by doing:
// class Person
// @subclass: require('csextends')
// Then your javascript consumers can do:
// var Child = Person.subclass(extensions)
// Just as before, which is really good for JavaScript users.
Discover the change history by heading on over to the HISTORY.md
file.
Discover how you can contribute by heading on over to the CONTRIBUTING.md
file.
These amazing people are maintaining this project:
No sponsors yet! Will you be the first?
These amazing people have contributed code to this project:
Licensed under the incredibly permissive MIT license
Copyright © 2013+ Bevry Pty Ltd us@bevry.me (http://bevry.me)
v1.0.2 2014 July 3
extendonclass
to csextends
FAQs
Use the Coffee-Script extends keyword outside of Coffee-Script. Useful for easily extending existing existing classes, e.g. `require('csextends')(klass, extensions)`, and for providing your module consumers with an easy way to extend your classes, i.e. `B
The npm package csextends receives a total of 8,874 weekly downloads. As such, csextends popularity was classified as popular.
We found that csextends demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
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.