WiPubSub.js provides a minimal higher-level wrapper around WiPubSub's API.
/*Data can be retrieved from the API either using callbacks (as in versions < 1.0)or using a new promise-based API. The promise-based API returns the raw Axiosrequest promise.*/;// unauthenticated clientconst aw = ;let user = gh; // not a gist yetuser;
var WiPubSub = ;// basic authvar gh =username: 'FOO'password: 'NotFoo'/* also acceptable:token: 'MY_OAUTH_TOKEN'*/;var me = gh; // no user specified defaults to the user for whom credentials were providedme;var clayreimann = gh;clayreimann;
WiPubSub.js is available from
npm or [unpkg][unpkg].
npm install WiPubSub-api
<!-- just WiPubSub-api source (5.3kb) --><!-- standalone (20.3kb) -->
WiPubSub.js is tested on Node.js:
WiPubSub.js uses Promise, hence it will not work in Node.js < 4 without polyfill.