A small library that provides reliable memories
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();
npm test
npm login
# usertoken npm account
npm publish
# token-memory package