The only thing that would worry me about that would be getting a reference error if libInline is not defined. This is what I use for checking libTokenMarkers in TokenNameNumber: // Make sure libTokenMarkers exists, and has the functions that are expected
if('undefined' === typeof libTokenMarkers
|| (['getStatus','getStatuses','getOrderedList'].find(k=>
!libTokenMarkers.hasOwnProperty(k) || 'function' !== typeof libTokenMarkers[k]
))
) {
// notify of the missing library
sendChat('',`/w gm <div style="color:red;font-weight:bold;border:2px solid red;background-color:black;border-radius:1em;padding:1em;">Missing dependency: <code>libTokenMarkers</code> Please install from the 1-click or download <a href="<a href="https://github.com/shdwjk/Roll20API/blob/master/libTokenMarkers/libTokenMarkers.js">here</a>.</div>`" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/libTokenMarkers/libTokenMarkers.js">here</a>.</div>`</a>);
return false;
} else {
return true;
}
I do this in my CheckInstall, and return true or false to note if all dependencies were satisfied, then my on('ready',...) is like this: on("ready",() => {
if(checkInstall()) {
registerEventHandlers();
}
});
since TokenNameNumber can't function without libTokenMakers.