
Research
/Security News
Malicious npm Packages Target WhatsApp Developers with Remote Kill Switch
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
@level-two/redis
Advanced tools
A message broker and cache extension for LevelTwo. Refer to the Worker API for function definitions.
import { createLevelTwoRedis } from "@level-two/redis";
// Integrates redis pubsub & cache into a LevelTwo instance
const levelTwo = createLevelTwoRedis({
clientOptions: { url: "redis://localhost:6379" },
});
// Create a worker for getting cacheable customer objects
const worker = levelTwo.createWorker("customer", async (ids, earlyWrite) => {
const rows = await mysql.query(
"SELECT id, name FROM customers WHERE id IN (?)",
[ids]
);
rows.forEach((row) => earlyWrite(row.id, row));
});
// Service method for getting a single customer
export async function getCustomer(id: string): Promise<Customer> {
return await worker.get(id);
}
// Service method for getting a list of customers
export async function getCustomerList(ids: string[]): Promise<Customer[]> {
return await worker.getMulti(ids);
}
redis
Existing redis client that should be used in this extension
clientOptions
Configuration options for creating a new redis client
broadcastChannel
Broadcast channel name for sending/receiving actions. Defaults to "level-two-broadcast"
cachePrefix
String prefix to use in front of each cache key
cacheDisabled
Indicates if cache should be disabled or not. Defaults to enabled
cacheDefaults
LevelTwo worker cache defaults
v2.0.0
Starting with version 2.0.0
: Iterable, peek
, peekMulti
, values
, entries
, forEach
all return CachedEntry
wrapped result values instead of the ResultValue
directly.
Switching to a wrapped CachedEntry
will allow for current and future expansion on utilities for metric tracking of entries.
FAQs
Redis message broker and cache extension of LevelTwo
The npm package @level-two/redis receives a total of 1 weekly downloads. As such, @level-two/redis popularity was classified as not popular.
We found that @level-two/redis 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
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.