token-memory
v0.2.2
Published
Durable distributed memory token
Downloads
21
Readme
token-memory
A small library that provides reliable memories
Installation
npm install --save token-memory
Usage Example
"use strict";
var Token = require("token-memory");
function newToken() {
Token(({id, root, token, broadcast, listen}) => {
token.get('id').once(idFound => {
if ( id === idFound) {
broadcast.get('PING').put(id)
listen.get('PONG').on((peer) => {
console.log('PEER :', peer);
});
}
})
})
}
newToken();
Tests
npm test
Publish
npm login
# usertoken npm account
npm publish
# token-memory package