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.
Clones a function (creates wrapper function), with the same signature as source function
Clones a function (creates wrapper function), with the same signature as source function
compression | size |
---|---|
fulcon.js | 945 B |
fulcon.min.js | 651 B |
fulcon.min.js.gz | 373 B |
$ npm install --save fulcon
var fulcon = require('fulcon');
function original(a, b, c)
{
return 42 + a + b + c;
}
assert.strictEqual(original.length, 3, 'signature of the original function has 3 arguments');
assert.strictEqual(original(1, 2, 3), 48, 'original function returns 48');
var cloned = fulcon(original);
assert.notStrictEqual(original, cloned, 'original and cloned functions are not the same function');
assert.strictEqual(cloned.length, 3, 'signature of the cloned function has 3 arguments');
assert.strictEqual(cloned(1, 2, 3), 48, 'cloned function returns 48');
Note: Beware of functions with side-effects! Cloned function calls original function under the hood, so it has same side-effects for better or for worst. Check test.js for details.
More examples can be found in test.js.
Or open an issue with questions and/or suggestions.
Fulcon is released under the MIT license.
FAQs
Clones a function (creates wrapper function), with the same signature as source function
The npm package fulcon receives a total of 31,397 weekly downloads. As such, fulcon popularity was classified as popular.
We found that fulcon 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.