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.
assert-jsnext
Advanced tools
This is a fork of the original assert package built to support
projects built using dependencies with the jsnext:main
field.
This module is used for writing unit tests for your applications, you can access it with require('assert-jsnext').
The API is derived from the commonjs 1.0 unit testing spec and the node.js assert module
Throws an exception that displays the values for actual and expected separated by the provided operator.
Tests if value is truthy, it is equivalent to equal(true, !!value, message);
Tests shallow, coercive equality with the equal comparison operator ( == ).
Tests shallow, coercive non-equality with the not equal comparison operator ( != ).
Tests for deep equality.
Tests for any deep inequality.
Tests strict equality, as determined by the strict equality operator ( === )
Tests strict non-equality, as determined by the strict not equal operator ( !== )
Expects block to throw an error. error can be constructor, regexp or validation function.
Validate instanceof using constructor:
throws(function() { throw new Error("Wrong value"); }, Error);
Validate error message using RegExp:
throws(function() { throw new Error("Wrong value"); }, /value/);
Custom error validation:
throws(function() {
throw new Error("Wrong value");
}, function(err) {
if ( (err instanceof Error) && /value/.test(err) ) {
return true;
}
}, "unexpected error");
Expects block not to throw an error, see throws
for details.
Tests if value is not a false value, throws if it is a true value. Useful when testing the first argument, error in callbacks.
FAQs
commonjs assert - node.js api compatible
The npm package assert-jsnext receives a total of 366 weekly downloads. As such, assert-jsnext popularity was classified as not popular.
We found that assert-jsnext 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.