Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
A Simple Redis Utility Function
npm install blackpink
npm install redis
This function allows you to use Redis to check that the data is up to date. It also allows you to check the maximum number.
import * as redis from "redis";
import blackpink from "blackpink";
const client = redis.createClient({});
const pink = blackpink(client);
void (async () => {
const list = ["a1.png", "a2.png", "a3.png"];
let isFirstLoop = true;
for (const item of list) {
const isNewest = await pink.checkIsNewest({
list: "community-meme",
item,
isFirstLoop,
limit: 300,
});
if (isFirstLoop) isFirstLoop = false;
if (isNewest) {
console.log("new meme", item);
break;
} else {
console.log("old meme", item);
}
}
})();
import * as redis from "redis";
import blackpink from ".blackpink";
const client = redis.createClient({});
const pink = blackpink(client);
void (async () => {
// Set cache
await pink.setCache({
key: "test",
value: "test",
// 7days
ttl: 60 * 60 * 24 * 7,
});
// Get cache
const data = await pink.getCache("test");
console.log(data);
// Check cache hit
const isHit = await pink.isCacheHit("test")
console.log(isHit);
// Invalidate cache
await pink.invalidateCache("test");
})();
import * as redis from "redis";
import blackpink from ".blackpink";
const client = redis.createClient({});
const pink = blackpink(client);
void (async () => {
// Set hash cache
await pink.setHashCache({
key: "test",
field: "test",
value: "test",
});
// Get hash cache
const data = await pink.getHashCache({
key: "test",
field: "test",
});
// Check hash cache hit
await pink.isHashCacheHit({
key: "test",
field: "test",
});
// Invalidate hash cache
await pink.invalidateHashCache({
key: "test",
field: "test",
});
// Invalidate all hash cache
await pink.invalidateAllHashCache("test");
})();
MIT Licensed
FAQs
Simple redis utility function
The npm package blackpink receives a total of 1 weekly downloads. As such, blackpink popularity was classified as not popular.
We found that blackpink 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.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.