
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.
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.
TypeScript autocompletion
.E2E
& unit testing
.Node.js
& modern browsers
.security
& developer experience
at heart.Non-intrusive
& concise API
to achieve 100% function coverage
.Runtime dependency error detection
to eliminate dependency hell
.2.7 kB
(minified + gzipped), zero dependencies
, and no vendor lock-in
.runtime testing
with minimal performance impact
.source: ESTest-benchmark-repo
npm add escss-estest
yarn add escss-estest
pnpm add escss-estest
bun add escss-estest
Water filter
function sum(a, b) {
// unhappy path: {...}
// Unhappy path filter. console.error (non-breaking). Collapsible. Removable.
{
ESTest(a, "number");
ESTest(b, "number");
}
// Happy path: inputs are valid
return a + b;
}
ESTest(input, type = "null", message = globalThis.__ESCSS_ESTEST__.message)
console.error(...)
case 1
import { ESTest } from "escss-estest";
function sum(a, b) {
{
ESTest(a, "number");
ESTest(b, "number");
}
return a + b;
}
case 2
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: "mike lee",
* email: "cspkno005@gmail.com"
* info: [
* {
* id: '1',
* city: 'foo',
* statusCode: 111
* },
* {
* id: '2',
* city: 'bar',
* statusCode: 222
* }
* ]
* }
*/
// Hint: Prevent undefined errors with optional chaining (?.)
{
ESTest(data.name, "string").regex(/^mike lee$/);
ESTest(data.email, "string").email();
ESTest(data.info[0]?.id, "string?");
ESTest(data.info[0]?.city, "string?");
ESTest(data.info[0]?.statusCode, "number?");
}
return data;
}
image
source: mike-demo-project
unSafeESTest(input, type = "null", message = globalThis.__ESCSS_ESTEST__.message)
throw new Error(...)
import { ESTest, unSafeESTest } from "escss-estest";
import express from "express";
const app = express();
const port = 3000;
app.use(express.json());
app.post("/demo", (req, res) => {
try {
const data = req.body;
/**
* data = {
* name: "mike lee",
* email: "cspkno005@gmail.com"
* }
*/
{
unSafeESTest(data.name, "string", "wrong name").regex(/^mike lee$/);
unSafeESTest(data.email, "string", "invalid email").email();
}
res.json({ message: "ok" });
} catch (err) {
res.status(400).json({ message: err.message });
}
});
app.listen(port, () => {
console.log(`http://localhost:${port}`);
});
image
source: mike-demo-project
createESTest(input, type, message)
bug reports
(for library authors/maintainers).import { createESTest } from "escss-estest";
// Encapsulate createESTest to provide your library's own default message
function ESTest(
input,
type,
message = "[libraryName] your message for others to help debugging",
) {
return createESTest(input, type, message);
}
globalThis.__ESCSS_ESTEST__.information
globalThis.__ESCSS_ESTEST__.message
internal bug reports
(for company teams)// Set in the entry point, e.g., main.js, App.vue, or App.jsx...
globalThis.__ESCSS_ESTEST__.message = "Please report this issue to ...";
globalThis.__ESCSS_ESTEST__.isESTestDisabled
Why have this feature?
Note: unSafeESTest
will not be affected (for security reasons)
globalThis.__ESCSS_ESTEST__.isESTestDisabled = true;
function sum(a, b) {
{
ESTest(a, "number");
ESTest(b, "number");
}
return a + b;
}
// same as below
function sum(a, b) {
return a + b;
}
globalThis.__ESCSS_ESTEST__.analysis
FAQs
A passive, non-intrusive JavaScript runtime validator designed to achieve 100% function coverage.
The npm package escss-estest receives a total of 2 weekly downloads. As such, escss-estest popularity was classified as not popular.
We found that 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.