
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
a-escss-estest
Advanced tools
A passive, non-intrusive JavaScript runtime validator designed to achieve 100% function coverage.
A passive, non-intrusive JavaScript runtime validator designed to achieve 100% function coverage.
npm add escss-estest
yarn add escss-estest
pnpm add escss-estest
bun add escss-estest
function demo() {
// {...} is a filter
{
ESTest(...)
ESTest(...)
}
// happy path
}
ESTest(input, type, publicMessage)
import { ESTest } from "escss-estest";
function sum(a, b) {
{
ESTest(a, "number");
ESTest(b, "number");
}
return a + b;
}
import { ESTest } from "escss-estest";
async function getApi(a, b) {
const apiData = await fetch("https://www.just-an-example.com/1");
const data = await apiData.json();
/**
* data = {
* name: 'demo',
* age: 999,
* info: [
* {
* id: '1',
* city: 'foo',
* statusCode: 111
* },
* {
* id: '2',
* city: 'bar',
* statusCode: 222
* }
* ]
* }
*/
// You might get 'undefined' data. Use the optional chaining operator (?.) to prevent undefined from breaking your app.
{
ESTest(data.name, "string");
ESTest(data.age, "number").min(0);
ESTest(data.info[0]?.id, "string");
ESTest(data.info[0]?.city, "string").regex(/(foo|bar)/);
ESTest(data.info[0]?.statusCode, "number?");
}
return data;
}
unSafeESTest(input, type, errorMessage)
import { unSafeESTest } from "escss-estest";
app.post("/validate", async (req, res) => {
try {
const data = req.body;
/**
* data = {
* name: 'foo',
* email: 'abc12345@gmail.com'
* }
*/
{
unSafeESTest(data.name, "string").min(3);
unSafeESTest(data.email, "string", "invalid email").email();
}
res.json({ message: "Validation passed" });
} catch (error) {
res.status(400).json({ errors: error });
}
});
globalThis.__ESCSS_ESTEST__.publicMessage
globalThis.__ESCSS_ESTEST__.publicMessage =
"Please note when the issue occurred and send the details to [link].";
globalThis.__ESCSS_ESTEST__.isESTestDisabled
note: unSafeESTest WON'T be disabled (security reason)
globalThis.__ESCSS_ESTEST__.isESTestDisabled = true;
function sum(a, b) {
{
ESTest(a, "number");
ESTest(b, "number");
}
return a + b;
}
// same as
function sum(a, b) {
return a + b;
}
FAQs
A passive, non-intrusive JavaScript runtime validator designed to achieve 100% function coverage.
The npm package a-escss-estest receives a total of 0 weekly downloads. As such, a-escss-estest popularity was classified as not popular.
We found that a-escss-estest demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.