Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
marsdb-sync-server
Advanced tools
It's a Meteor compatible DDP server, based on MarsDB, but with major improvements. It supports methods, pub/sub and collection operations. It have very similar to the original Meteor interface, so, you really knows how to use it, if you are familiar with Meteor. But it also highly customizable, because it can be used with any server, that you passed to a configure
function. Check out a basic example with express and webpack.
It's only a concept until 1.0. Use it for your own risk. It does not support scaling, handled only changes happened on one instance. Scaling will be handled by MarsDB-Mongo module.
The repository comes with a simple example. To try it out:
git clone https://github.com/c58/marsdb-sync-server.git
cd marsdb-sync-server/example && npm install
npm start
Then, just point your browser at http://localhost:3000
.
import http from 'http';
import MarsSync from 'marsdb-sync-server';
import requireDir from 'require-dir';
// Some server configuration
// ...
const server = http.createServer();
// Setup marsdb-sync-server
MarsSync.configure({ server: server });
// You must require all your models, publishers and methods.
// They will be registered in MarsSync server.
requireDir('./js/models');
requireDir('./js/publishers');
requireDir('./js/methods');
import UserModel from '../models/User.model';
import TodoModel from '../models/Todo.model';
import { publish } from 'marsdb-sync-server';
// Publish all todos in a collection and all users,
// who have created todos
publish('allTodos', (ctx, arg1, arg2) => {
// Publisher always receive first `ctx` arguments,
// that contains `connection` field for now.
// In next versions it would be extended by other modules
return TodoModel.find().join((todo) => [
// Define joins for each todo, it's not reactive
// (changed user will not be changed in clients)
UserModel.find(todo.authorId),
// ...and this reactive. All changed users will be
// sended the clients.
UserModel.find(todo.authorId).observe(),
]);
// Must return a cursor or array of cursors.
});
import { method } from 'marsdb-sync-server';
// Defines a method named 'seyHello'
method('sayHello', (ctx, name = 'unknown') => {
// First argument the same as in `publish`
const msg = 'Hello, ' + name;
return msg;
// Might return something.
// If returned promise or array of promises, then an
// `updated` message sended to a client when all promises
// will be resolved.
});
By default MarsDB uses memory to store collections. You can easily configure it for using MongoDB (or other storages) as a backend. Just configure MarsDB to use MongoDB before any instance of a Collection class created
// server.js
import MarsMongo from 'marsdb-mongo';
// DO NOT import Colllection releted modules here
// ...other imports
// ...some server configuration
MarsMongo.configure({ url: 'mongodb://127.0.0.1:27017' });
MarsSync.configure({ server: server });
// Require all Collection releted modules
requireDir('./js/models');
requireDir('./js/publishers');
requireDir('./js/methods');
I'm waiting for your pull requests and issues.
Don't forget to execute gulp lint
before requesting. Accepted only requests without errors.
See License
FAQs
MarsDB DDP server for wotking with MarsDB Cleint (or with Meteor)
The npm package marsdb-sync-server receives a total of 0 weekly downloads. As such, marsdb-sync-server popularity was classified as not popular.
We found that marsdb-sync-server 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.