
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@cacher/cacher
Advanced tools
Modern implementation of key-value storage
Node.js 14.0.0 or newer is required
yarn add @cacher/cacher
npm i @cacher/cacher
import { Cacher } from '@cacher/cacher';
interface IMyData {
someData: boolean;
}
const cacher = new Cacher<IMyData>({
namespace: 'users'
});
async function run() {
// Single
const { 1: user } = await cacher.get({
key: '1',
// alias: 'user'
});
// With alias
const { user } = await cacher.get({
key: '1',
alias: 'user'
});
// Multi get
const result = await cacher.get([
{ key: '1' },
{ key: '2' },
{ key: '3' },
{ key: '4' }
]);
// result[id] // => IMyData | undefined
// Set
await cacher.set({
key: '1',
value: {
someData: true
},
// ms
// ttl: 10_000
});
// Multi set
await cacher.set([
{
key: '1',
value: {
someData: true
},
// ms
// ttl: 10_000
},
{
key: '2',
value: {
someData: true
},
// ms
// ttl: 10_000
}
]);
// Increment
// /!\ Cacher data must be float
await cacher.increment({
key: '1',
value: 5
});
// Multi set
await cacher.increment([
{
key: '1',
value: 2
},
{
key: '2',
value: 4
}
]);
// Delete
await cacher.delete('1');
// Multi delete
await cacher.delete(['1', '2', '3']);
// Update ttl
await cacher.touch({
key: '1',
ttl: 60_000
});
// Multi update ttl
await cacher.touch([
{
key: '1',
ttl: 60_000
},
{
key: '2',
ttl: 60_000
}
]);
// Clear all namespace
await cacher.clear();
}
run().catch(console.log);
import { Cacher } from '@cacher/cacher';
import { RedisAdapter } from '@cacher/redis';
const adapter = new RedisAdapter();
const cacher = new Cacher({
adapter,
namespace: 'users'
});
FAQs
Modern implementation of key-value storage
We found that @cacher/cacher 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.