Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ddp-server-reactive

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ddp-server-reactive

A ddp server for nodejs with reactive collections

  • 0.4.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

DDP Server with reactive collections

DDP-Server-Reactive is a nodejs based DDP Server.

Usage

// Create a server listening on the default port 3000
var server = new DDPServer();

// Create a reactive collection
// All the changes below will automatically be sent to subscribers
var todoList = server.publish("todolist");

// Add items
todoList[0] = { title: "Cook dinner", done: false };
todoList[1] = { title: "Water the plants", done: true };

// Change items
todoList[0].done = true;

// Remove items
delete todoList[1]

// Add methods
server.methods({
  test: function() {
    return true;
  }
});

You can then connect to it using a ddp client such as ddp

Advanced Usage

Create a server with a different port:

var server = new DDPServer({ port: 80 });

Create a server using an existing http server so you use the same IP number for DDP and for web:

var app = express();
app.server = http.createServer(app);
var server = new DDPServer({ httpServer: app.server });

Keywords

FAQs

Package last updated on 14 Oct 2016

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc