Product
Socket Now Supports uv.lock Files
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
CocktailJS is a small library to explore traits, talents, inheritance and annotations concepts in nodejs - Shake your objects and classes with Cocktail!
Cocktail is a small but yet powerful library with very simple principles:
##Reuse code Cocktail explores three mechanisms to share/reuse/mix code:
##Keep it simple
Cocktail has only one public method Cocktail.mix()
but it relies on annotations
to tag some meta-data that describe the mix.
###Annotations Annotations are simple meta-data Cocktail uses to perform some tasks over the given mix. They become part of the process but usually they are not kept in the result of a mix.
var Cocktail = require('Cocktail'),
MyClass = function(){};
Cocktail.mix(MyClass, {
'@properties': {
name: 'default name'
}
});
In the example above we created a "Class" named MyClass, and we use the @properties
annotation to create the property name and the corresponding setName and getName methods.
As it was mentioned before, annotations are meta-data, which means that they are not part of MyClass or its prototype.
npm install cocktail
or add cocktail to your package.json
and then npm install
var Cocktail = require('Cocktail')
in your file.Guides can be found at CocktailJS Guides
The latest documentation is published at CocktailJS Documentation
A Cocktail playground can be found in cocktail recipes repo.
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
0.1.0 (current master)
0.0.4
0.0.3
0.0.2
0.0.1
Copyright (c) 2013 Maximiliano Fierro
Licensed under the MIT license.
FAQs
CocktailJS is a small library to explore traits, talents, inheritance and annotations concepts in nodejs - Shake your objects and classes with Cocktail!
The npm package cocktail receives a total of 118 weekly downloads. As such, cocktail popularity was classified as not popular.
We found that cocktail 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.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.