telehash-token
v0.0.1
Published
Adding hashtoken support to telehash-js
Downloads
3
Readme
hashtoken
Adding hashtoken support to telehash-js
Usage
var self = new require("telehash-js").switch();
require("telehash-token").install(self);
// returns a token string
self.token();
// returns a token string, fires callback(from) when it's called
self.token(callback);
// listens for token, fires callback(from) when it's called
self.token(token, callback);
// called for any un-matched tokens
self.tokens = function(token, from, callback){ callback(true||false); };
// use a token, fires callback(err, to)
self.dispense(token, callback);