Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Jetstream for Node is a server that brokers syncing Jetstream models over the Jetstream Sync protocol. Out of the box it has a single Websocket transport adapter with the ability to add custom transport adapters.
CONTRIBUTION.md
.npm install jetstream
npm start
npm test
See the docs
directory. A good start is with docs/overview.md
.
Jetstream works with two basic concepts: All your model objects extend from the superclass ModelObject
and one of your ModelObject instances will be the root for your model tree encapsulated by a Scope
.
Let's model a canvas of shapes:
var createModel = require('jetstream').model;
var Shape = createModel('Shape', function() {
this.has('x', Number);
this.has('y', Number);
this.has('width', Number);
this.has('height', Number);
this.has('type', Number);
});
var Canvas = createModel('Canvas', function() {
this.has('name', String);
this.has('shapes', [Shape]);
});
Supported types are String
, Number
, Boolean
, Date
, ModelObject
and [ModelObject]
var createScope = require('jetstream').scope;
var createServer = require('jetstream');
var createWebsocketTransport = require('jetstream').transport.WebsocketTransport.configure;
// Example of connecting multiple clients to a shared scope
var canvas = new Canvas();
canvas.name = 'Shapes Demo';
var scope = createScope({name: 'Canvas'});
scope.setRoot(canvas);
// Start server with default transports
var websocketTransport = createWebsocketTransport({port: 3000});
var transports = [websocketTransport];
var server = createServer({transports: transports});
server.on('session', function(session, params, callback) {
// Accept the session, no authentication or authorization in this example
callback();
session.on('fetch', function(name, params, callback) {
// Verify fetching the scope
if (name !== scope.name) {
return callback(new Error('No such scope'));
}
callback(null, scope);
});
});
Jetstream uses JSON-based messages to create sessions, fetch scopes and synchronize changes. In case you want to build your own client or server, refer to the protocol documentation.
Jetstream is available under the MIT license. See the LICENSE file for more info.
FAQs
Jetstream Sync server framework to sync local and remote models
The npm package jetstream receives a total of 4 weekly downloads. As such, jetstream popularity was classified as not popular.
We found that jetstream 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
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.