Skip to content

Instantly share code, notes, and snippets.

Last active May 29, 2021
What would you like to do?
* This is my version of what I embed into libraries I want to track, as cluster.
* This way it ensures that consistent name, version used throughout, and easy to define namespace
* Note use of "name" "space" parameters
function TrackMyself ({name='dottie', space=null, version='v1.5', ...kwargs}={}) {
if (Object.keys(kwargs).length>0) throw new TypeError("Unexpected param received");
const track = cttLibTracker.TrackMyself;
const options = {
name: space != null ? `${name}_${space}`: name,
return track;
* Usage
function report () {
const track = TrackMyself({sspace: 'init'}); // throws TypeError
const track = TrackMyself({space: 'init'});
const output = track.currentUserUsage();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment