
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
@sovereignbase/observed-remove-set
Advanced tools
UUIDv7-optimized observed-remove set for JavaScript and TypeScript with delta, merge, and snapshot events.
UUIDv7-optimized observed-remove set for JavaScript and TypeScript. It gives each value a stable UUIDv7 identity, stores removals as tombstoned identifiers, and exposes local mutation, merge, and snapshot flows through events.
This package is best suited to membership state and static metadata where values are appended or removed as whole units. For the model itself and a possible tombstone garbage-collection strategy, see the specification at https://sovereignbase.github.io/observed-remove-set/.
EventTarget and CustomEvent; Workers/Edge: tested in Bun, Deno, Cloudflare Workers, and Edge Runtime.EventTarget, CustomEvent.delta for local mutations, merge for accepted ingress changes, snapshot only when explicitly requested.npm install @sovereignbase/observed-remove-set
# or
pnpm add @sovereignbase/observed-remove-set
# or
yarn add @sovereignbase/observed-remove-set
# or
bun add @sovereignbase/observed-remove-set
# or
deno add jsr:@sovereignbase/observed-remove-set
# or
vlt install jsr:@sovereignbase/observed-remove-set
Use the snapshot event when you want the full current replica state, the
delta event when you want to forward locally produced changes, and the
merge event when you want to react to accepted ingress changes.
has() and remove() accept either a stored value or a bare UUIDv7 string.
import { ORSet } from '@sovereignbase/observed-remove-set'
const set = new ORSet<{ role: string }>()
set.addEventListener('snapshot', (event) => {
localStorage.setItem('members', JSON.stringify(event.detail))
})
set.append({ role: 'admin' })
set.snapshot()
import { ORSet } from '@sovereignbase/observed-remove-set'
const set = new ORSet<{ role: string }>()
set.addEventListener('delta', (event) => {
upstream.broadcast(JSON.stringify(event.detail))
})
set.append({ role: 'admin' })
const [admin] = set.values()
set.remove(admin.__uuidv7)
import { ORSet } from '@sovereignbase/observed-remove-set'
const set = new ORSet<{ name: string }>()
set.addEventListener('merge', (event) => {
for (const value of event.detail.additions) {
console.log('added', value)
}
for (const tombstone of event.detail.removals) {
console.log('removed', tombstone)
}
})
upstream.onmessage = (snapshot) => {
set.merge(snapshot)
}
import { ORSet } from '@sovereignbase/observed-remove-set'
const set = new ORSet<{ name: string }>()
set.append({ name: 'alice' })
const [alice] = set.values()
set.remove(alice)
const tombstones = set.tombstones()
for (const tombstone of tombstones) {
console.log(tombstone)
}
new ORSet(snapshot) and merge(snapshot) throw ORSetError with code BAD_SNAPSHOT when the top-level snapshot shape is malformed.has() and remove() accept either a stored value object or a UUIDv7 string.append(), clear(), and remove() return void and dispatch only delta.merge() returns void and dispatches only merge.snapshot() returns void and dispatches only snapshot.c8 — 100% statements / branches / functions / lines.How it was run: npm run bench
Environment: Node v22.14.0 (win32 x64)
| Benchmark | Result |
|---|---|
| constructor hydrate x512 | 1,774 ops/s (563.8 ms) |
| has live | 1,537,058 ops/s (130.1 ms) |
| has live string | 1,730,831 ops/s (115.6 ms) |
| values x512 | 2,378 ops/s (2102.4 ms) |
| snapshot x512 | 1,732 ops/s (2886.5 ms) |
| append fresh | 58,219 ops/s (858.8 ms) |
| remove live | 120,856 ops/s (413.7 ms) |
| remove live string | 139,508 ops/s (358.4 ms) |
| clear x512 | 821 ops/s (2435.9 ms) |
| merge add x512 | 1,487 ops/s (840.3 ms) |
| merge mixed x512 | 648 ops/s (1158.1 ms) |
| replica roundtrip x256 | 856 ops/s (1752.8 ms) |
Results vary by machine.
Apache-2.0
FAQs
UUIDv7-optimized observed-remove set for JavaScript and TypeScript with delta, merge, and snapshot events.
We found that @sovereignbase/observed-remove-set demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.