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.
@hitorisensei/memoizee-decorator
Advanced tools
Memoization decorator backed by memoizee and hash-sum
Adds memoization decorator for methods and getters.
Uses memoizee library for memoization.
Uses hash-sum library as a default cache-key generation algorithm.
import { Memoize } from '@hitorisensei/memoizee-decorator';
class MyClass {
@Memoize()
public getMyValue(): number {
console.log('My value is calculated');
return someExpensiveCalculation();
}
}
const myClass = new MyClass();
myClass.getMyValue(); // console logs 'My value is calculated' only once
myClass.getMyValue(); // returns cached value
Decorator can be called with all memoizee options.
import { Memoize } from '@hitorisensei/memoizee-decorator';
class MyClass {
@Memoize({
maxAge: 1000,
max: 100,
})
public getMyValue(): number {
console.log('My value is calculated');
return someExpensiveCalculation();
}
}
import { Memoize, clearMemoization } from '@hitorisensei/memoizee-decorator';
class MyClass {
@Memoize()
public getMyValue(): number {
console.log('My value is calculated');
return someExpensiveCalculation();
}
}
const myClass = new MyClass();
myClass.getMyValue(); // console logs 'My value is calculated' only once
myClass.getMyValue(); // returns cached value
clearMemoization(myClass, 'getMyValue'); // clears cache
myClass.getMyValue(); // console logs 'My value is calculated' again
FAQs
Memoization decorator backed by memoizee and hash-sum
The npm package @hitorisensei/memoizee-decorator receives a total of 27 weekly downloads. As such, @hitorisensei/memoizee-decorator popularity was classified as not popular.
We found that @hitorisensei/memoizee-decorator 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.
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.