Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
redis-promise-lock
Advanced tools
locks stuff until you unlock it. works with redis 4.x. promise based. simple.
When creating an instance, you can pass an options object as the second argument with the following properties:
number
number of times lock is trying to be set before bailing out (default: 10)number
amount of time in ms to wait between retries (default: 100)number
ttl of the lock to be set in redis before its removed by redis itself in seconds, if set to 0, lock wont have a ttl (default: 3)Those can also be overwritten in the acquireLock
function.
import { createClient } from 'redis'
import { Lock } from './src/lock'
const client = createClient({
url: 'redis://127.0.0.1:6379'
})
;(async () => {
await client.connect()
const lockerRoom = new Lock(client)
await lockerRoom.acquireLock('myawesomelock')
// ... do some stuff while the lock is active
await lockerRoom.releaseLock('myawesomelock')
})()
FAQs
Simple promise-based redis lock. No bells, no whistles.
We found that redis-promise-lock 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.