Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
#prime |prīm|
prime is an Object Oriented JavaScript library. It helps you with prototypal inheritance and contains generic utilities for every-day JavaScripting.
No Native JavaScript Objects were harmed in the making of this library.
A short overview of the available modules. For more information, refer to the documentation.
The function to create new primes.
var prime = require("prime")
var Animal = prime({
say: function(){
return "!!"
}
})
var Emitter = require("prime/emitter")
var Cat = prime({
inherits: Animal,
mixin: Emitter,
say: function(){
return "meaow" + Cat.parent.say.call(this)
}
})
The event emitter.
var Emitter = require("prime/emitter")
var Dog = prime({
inherits: Animal,
say: function(){
var word = "wuff" + Dog.parent.say.call(this)
this.emit("say", word)
return word
}
})
Dog.implement(new Emitter)
var barkley = new Dog
barkley.on("say", function(word){
console.log("barkley barked", word)
})
Simple WeakMap-like object.
var Map = require("prime/map")
var map = new Map()
map.set(domElement, "header")
map.set(domElement2, "footer")
map.get(domElement) // "header"
map.get(domElement2) // "footer"
Optimized timeouts / immediates / animationFrames.
var defer = require("prime/defer")
defer.frame(function() {
console.log('on next animation frame');
});
defer.immediate(function() {
console.log('on platform next tick.');
});
defer.timeout(function() {
console.log('late');
}, 500);
FAQs
prime, an OOP JavaScript library for node and the web.
The npm package prime receives a total of 6,705 weekly downloads. As such, prime popularity was classified as popular.
We found that prime 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.