0.0.9 • Published 7 years ago
internode v0.0.9
internode
init
In express's app.js
, init internode with the express app
and the domain base path on which to sync.
internode will add /sync
to the base path and try to send and recieve sync data on that path.
let express = require('express');
let app = express();
require('internode').InterNode.init(app, 'https://domain.com');
set(key: string, value: string, expire?: number)
Internode.set('john@gmail.com', 'John Doe', 3600000)
get(key: string)
InterNode.get('john@gmail.com')
--> 'John Doe'
aggregate(key: string, value: number, expire: number)
InterNode.aggregate('account_dollar_balance', 257, 3600000);
InterNode.aggregate('account_dollar_balance', 129, 3600000);
getAggregated(key: string)
InterNode.getAggregated('account_dollar_balance');
--> 386