
Security News
/Research
Fake Corepack Site Distributes Infostealer and Proxyware to Developers
A fake corepack.org site is impersonating the Node.js tool and delivers an infostealer and proxyware to developers who download it.
y-protocols
Advanced tools
Binary encoding protocols for syncing, awareness, and history information
This API is unstable and subject to change.
import * as awarenessProtocol from 'y-protocols/awareness.js'
The Awareness protocol implements a simple network agnostic algorithm that manages user status (who is online?) and propagate awareness information like cursor location, username, or email address. Each client can update its own local state and listen to state changes of remote clients.
Each client has an awareness state. Remote awareness are stored in a Map that maps from remote client id to remote awareness state. An awareness state is an increasing clock attached to a schemaless json object.
Whenever the client changes its local state, it increases the clock and
propagates its own awareness state to all peers. When a client receives a remote
awareness state, and overwrites the clients state if the received state is newer
than the local awareness state for that client. If the state is null, the
client is marked as offline. If a client doesn't receive updates from a remote
peer for 30 seconds, it marks the remote client as offline. Hence each client
must broadcast its own awareness state in a regular interval to make sure that
remote clients don't mark it as offline.
const ydoc = new Y.Doc()
const awareness = new awarenessProtocol.Awareness(ydoc)
clientID:number
getLocalState():Object<string,any>|null
setLocalState(Object<string,any>|null)
setLocalStateField(string, any)
getStates():Map<number,Object<string,any>>
on('change', ({ added: Array<number>, updated: Array<number>
removed: Array<number> }, [transactionOrigin:any]) => ..)
on('update', ({ added: Array<number>, updated: Array<number>
removed: Array<number> }, [transactionOrigin:any]) => ..)
The MIT License © Kevin Jahns
Automerge is a library for building collaborative applications using CRDTs. It provides similar functionality to Yjs and y-protocols, allowing for real-time collaboration and conflict resolution. However, Automerge focuses more on simplicity and ease of use, while Yjs and y-protocols offer higher performance and more advanced features.
ShareDB is a real-time database backend based on Operational Transformation (OT). It allows multiple users to collaborate on the same data in real-time. While ShareDB uses OT instead of CRDTs, it provides similar real-time collaboration features and can be used with WebSocket for communication.
Gun is a decentralized, real-time, graph database that supports real-time data synchronization and offline-first capabilities. It provides similar real-time collaboration features as y-protocols but focuses on decentralized data storage and peer-to-peer communication.
FAQs
Yjs encoding protocols
The npm package y-protocols receives a total of 2,486,438 weekly downloads. As such, y-protocols popularity was classified as popular.
We found that y-protocols 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
/Research
A fake corepack.org site is impersonating the Node.js tool and delivers an infostealer and proxyware to developers who download it.

Research
/Security News
A large-scale campaign abused GitHub Actions in compromised repositories to exploit CVE-2026-41940 in cPanel and WHM and steal server credentials.

Security News
Five frontier LLMs generated the same nonexistent package names, leaving 53 available for potential slopsquatting across PyPI and npm.