I want to create a JavaScript library and have it readily available everywhere, exactly as Moment.js
does.
For example, when I import Moment.js
I can use it wherever I want by just typing:
moment.someMomentFunction()
Similarly, I'd want to call my function from everywhere by just doing:
mylib.function1()
mylib.function2()
etc..
Looking at the Moment.js
source code I cannot see any reference to the window
object (which is the one you should use if you want your object to be global)