# ddp-micro

> Meteor's DDP server, supporting Meteor-style reactive subscriptions and methods.

Latest version **1.0.1** (published 2017-05-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install ddp-micro
pnpm add ddp-micro
yarn add ddp-micro
bun add ddp-micro
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2017-05-29 |
| First published | 2017-05-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | James Loper |
| Maintainers | jamesloper |
| Keywords | ddp, meteor, collection, proxy, reactive |

## Links

- npm: https://www.npmjs.com/package/ddp-micro
- Repository: https://github.com/jamesloper/ddp-micro
- Issues: https://github.com/jamesloper/ddp-micro/issues
- npm.io page: https://npm.io/package/ddp-micro

## Dependencies (1)

- [faye-websocket](https://npm.io/package/faye-websocket.md) ^0.11.1

## Recent versions

- 1.0.1 (latest) — 2017-05-29
- 1.0.0 — 2017-05-22

## README

Meteor DDP server, supporting Meteor-style reactive subscriptions and methods. Implemented in a small efficient way.

### Create DDP Server

``` javascript
var DDP = new DDPServer({port:3000});
```

### Create Subscriptions

Subscriptions are not backed by Mongo documents. You can create fully custom subscriptions. Internally the data structure is a hash object where the keys are the `_id`'s and the values are the values:

``` javascript
var Files = server.publish('Files');
Files.id1 = {name:'swiggity-swooty.mp4'};
Files.id2 = {name:'coming-for-that-booty.mp4'};
```

When you set or remove a property of `Files`, it will send the appropriate message over DDP.	
	
### Methods

Methods are invoked with the arguments supplied by the connected client and a node-style callback. To return a value, invoke the callback.

``` javascript
DDP.methods({
    test(value, callback) {
        callback(null, value)
    }
});
```

### Add DDP to an existing HTTP server

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

---
_Source: https://npm.io/package/ddp-micro · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
