SLEEP
SLEEP is a protocol envisioned by @maxogden for open data publication and synchronization. It stands for Syncasble Lightweight Event Emitting Persistence, but is mostly just a pun on REST.
The official SLEEP spec lives on dataprotocols.org. sleep-ref
doesn't necessarily follow the spec as it is currently written -- consider this to be more experimental.
This project is meant to iterate on the spec through implementation and also to produce a module that is easily usable by other databases to expose their data with SLEEP.
Server
var sleep = http = net = ; { var c = mydatabase // emits {id:'uuid', seq:1}, {id:'uuid2', seq:3} // if opts.include_data it emits e.g. c.data = mydatabase.get(c.id) return c} var sl = http net
Client
var sleep = changes = sleep ;changeschanges
sleep.client(url[, opts])
takes all valid SLEEP options. The url responds to the following protocols: http:
, https:
, tcp:
, and tls:
. You can pass tls options to opts
via the tls
property.
Tests
% make test
or if you don't have make
:
% npm install
% npm test