2.1.1 • Published 6 years ago
prosync v2.1.1
node-prosync
Node.js client library for interacting with Prosync.
About
Prosync provides an over the network data stash and network message system. The Prosync server is designed to accept any type of data format that can be stored in plain text. Node-prosync offers a client for interacting in plain text and a client that offers a JSON layer ontop of the plain text. The JSON layer provides simple functions for filtering the data.
Plain Text Client
var prosync = require('prosync').client({
port:33008,
host:'127.0.0.0',
stash:'stash',
key:__dirname + '/private.pem'
});
prosync.on('sync', function(data) { //called when the server issues an updated version
console.log('data update:', data);
});
prosync.connect(function(data) {
prosync.stash('hello world');
});
JSON Client
var prosync = require('prosync').jsonClient({
port:33008,
host:'127.0.0.0',
stash:'stash',
key:__dirname + '/private.pem'
});
prosync.connect(function(data) {
prosync.create('users');
var user = prosync.insert('users', {email:'bob.smith@microsoft.com'}); //prosync json client auto generates an ID
setTimeout(function() {
console.log(prosync.get('users', user.id));
}, 500);
});
License
node-prosync is released under the Apache-2.0 license.