Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
@usecanvas/sharejs-wrapper
Advanced tools
This is a wrapper around the somewhat confusing ShareJS API, and it also tries to simplify handling disconnected WebSocket clients.
The full documentation can be found here.
The ShareJS Wrapper object is an event emitter. Create a wrapper, and the wrapper should take care of setting itself up and emitting events at the proper times.
var ShareJSWrapper = require('sharejs-wrapper');
var share = new ShareJSWrapper({
accessToken: user.apiAccessToken,
canvasID: canvasID,
realtimeURL: 'wss://api.usecanvas.com/realtime',
orgID: orgID
});
// Tell the client to connect to the ShareJS server.
share.connect(function onConnect() {
// Get the current content of the document.
console.log(share.content);
// Send insert/remove operations to the server.
share.insert(0, 'insert some text');
share.remove(0, 'remove some text'.length);
// Handle an `insert` event from the server.
share.on('insert', function onInsert(op) {
// Handle an insert
});
// Handle a `remove` event from the server.
share.on('remove', function onRemove(op) {
// Handle a remove
});
});
/*
* Handle an unexpected disconnect event from the server. This happens when the
* client disconnects without having `.disconnect()` called, and several
* reconnection attempts fail.
*/
share.on('disconnect', function onDisconnect(err) {
console.log(err.message);
});
// Manually disconnect the client.
share.disconnect();
An example can be found in
test/server/public/main.js
.
FAQs
A wrapper around ShareJS for easier iOS development
We found that @usecanvas/sharejs-wrapper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 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
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.