
Company News
Socket Joins the OpenJS Foundation
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.
npm install sleep-ref
SLEEP is a protocol envisioned by @maxogden for open data publication and synchronization.
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.
var sleep = require('sleep-ref')
, http = require('http')
;
function getSequences (opts, cb) {
var c = mydatabase.changes() // [{id:'uuid', seq:1}, {id:'uuid2', seq:3}]
if (opts.include_data) c.forEach(function (c) {c.data = mydatabase.get(c.id)})
cb(null, c)
}
var sl = sleep(getSequences)
http.createServer(function (req, resp) {
sl.httpHandler(req, resp)
})
net.createServer(function (socket) {
sl.netHandler(socket)
})
var sleep = require('sleep-ref')
, changes = sleep.client('http://localhost:8888/', {include_data})
;
changes.on('data', function (entry) { console.log(entry) })
changes.on('end', function () { console.log('up to date') })
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.
FAQs
Reference implementation of the SLEEP protocol.
The npm package sleep-ref receives a total of 11 weekly downloads. As such, sleep-ref popularity was classified as not popular.
We found that sleep-ref 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.

Company News
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.

Security News
A compromised npm publish token was used to push a malicious postinstall script in cline@2.3.0, affecting the popular AI coding agent CLI with 90k weekly downloads.