Javascript pub sub library