
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
level-update
Advanced tools
A levelup plugin that can be used implements conditional updates.
The name of this module may change if I think of something better.
level-update intercepts database mutations (put, del, batch),
retrives the current value for that key, and passed the old value,
and the new value to a user supplied merge function.
The merge function can be used a number of ways - if it throws an error, the put/del/batch will callback an error.
If it returns a string or Buffer, then that value will be saved instead.
And if it returns something else, then the new value will be saved as normal.
var Update = require('level-update')
Update(db, function merge (newValue, oldValue, key) {
return someSortOfMerge(newValue, oldValue)
})
db.put('key', 'VALUE', function (err) {
//this will be intercepted
})
If oldValue is null, the operation is a create.
If newValue is null, the operation is a delete.
Otherwise, the operation is an update.
check that new value is correct, or throw error.
check that new value comes after old, or merge concurrent updates.
level-update uses lock to preserve
update scemantics, this is necessay to be able so that merged mutations can
behave deterministically - level-update does a get, and then combines the
current value with the new value. It is essetial that the value has not
changed in between the get and the put!
level-update doesn't support the chained interface for db.batch(), but only the array interface.
MIT
FAQs
A levelup plugin that can be used implements conditional updates.
We found that level-update 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.