Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
node-redis-lock
Advanced tools
Node.js redis locking system.
$ npm install node-redis-lock
const Lock = require('node-redis-lock');
const redis = require('redis');
const client = redis.createClient();
// Instantiate a lock.
let lock = new Lock({namespace: 'locking'}, client);
// Acquire a lock.
const key = 'job1';
const value = ['owned-by-',require('os').hostname()].join('');
const ttl = 1; // seconds
lock.acquire(key, ttl, value, (e, r) => {
// r === true;
});
// Renew a lock.
// It fails if the value is different.
lock.renew(key, ttl, value, (e, r) => {
// r === true;
});
// Release a lock.
// The value has to be passed to ensure another host doesn't release it.
lock.release(key, value, (e, r) => {
//
});
// Does a lock exist?
lock.isLocked(key, (e, r) => {
// Lock if r exists (this is the value of the lock)
});
$ npm test
Philmod <philippe.modard@gmail.com>
FAQs
Node.js Redis locking tool.
The npm package node-redis-lock receives a total of 5 weekly downloads. As such, node-redis-lock popularity was classified as not popular.
We found that node-redis-lock demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.