
Threat Research
/Security News
Searchjacked: Hidden Browser Extensions Hijack Searches for 13 Million Users
319 browser extensions installed by 13.4 million users hijack searches, capture queries, and collect referral payments from Yahoo and Bing.
@tnezdev/actions
Advanced tools
Patterns to express business logic using dependency injection for side-effects
Patterns to express business logic using dependency injection for side-effects for easy unit testing.
npm i @tnezdev/actionspnpm add @tnezdev/actionsyarn add @tnezdev/actionsYou can express your core business logic as actions. You may do this in files that look something like this toy example:
// @/actions/src/weather/get-temperature.ts
import { createAction, ActionHandler } from "@tnezdev/actions";
import type { WeatherClient } from "@/clients/weather";
export type GetTemperatureContext = {
client: WeatherClient;
/**
* Which scale to report the temperature.
* @default "celsius"
*/
scale?: "celsius" | "fahrenheit";
};
export type GetTemperatureInput = { zipcode: string };
export type GetTemperatureOutput = string;
const handler: ActionHandler<
GetTemperatureContext,
GetTemperatureInput,
GetTemperatureOutput
> = async (ctx, input) => {
const { client, scale } = ctx;
const { zipcode } = input;
const { temperature } = await client.getTempearture(zipcode, { scale });
return temperature;
};
export const GetTemperatureAction = createAction("GetTemperature", handler);
This can then be configured as:
// apps/src/app/weather/get-temperature/route.ts
// (exposing a route at GET https://somedomain.com/weather/get-temperature/[zipcode])
import * as z from "zod";
import { GetTemperatureAction } from "@/actions/weather";
import { WeatherClient } from "@/clients/weather";
import type { NextResponse } from "next/server";
const getTempeartureAction = new GetTemperatureAction({
client: new WeatherClient(),
scale: "fahrenheit",
});
const RequestContext = z.object({
params: z.object({
zipcode: z.string(),
}),
});
export async function GET(request: Request, requestContext: unknown) {
const { zipcode } = RequestContext.parse(requestContext);
const { ok, data, error } = await getTempeartureAction.run({
zipcode: "12345",
});
return ok
? NextResponse.json(data)
: NextResponse.status(500).json({ error: error.message });
}
When run, this will produce the following logs:
[GetTemparature:{correlation-id}] Action Started (input: {"zipcode":"12345"})
[GetTempearture:{correlation-id}] Action Completed (data: {"temperature":"75˚F"})
FAQs
Patterns to express business logic using dependency injection for side-effects
The npm package @tnezdev/actions receives a total of 0 weekly downloads. As such, @tnezdev/actions popularity was classified as not popular.
We found that @tnezdev/actions 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.

Threat Research
/Security News
319 browser extensions installed by 13.4 million users hijack searches, capture queries, and collect referral payments from Yahoo and Bing.

Threat Research
Malicious Firefox extensions mimic Phantom, Jupiter, and Bitget wallets to steal recovery phrases and private keys, with one fetching its payload remotely.

Product
Socket Threat Intel now shows which malware campaigns were blocked or detected in your organization, with links to scans and Firewall events.