right now library assumes the browser environment. it's better to create a wrapper that will avoid creating global variables if an AMD loader is detected and also if running on nodejs...
based on the current implementation it's actually easy to create a wrapper that would run on multiple environments:
(function(global){
// YOUR CODE GOES HERE //
//exports to multiple environments
if(typeof define === 'function' && define.amd){ //AMD
define('tim', [], tim);
} else if (typeof module !== 'undefined' && module.exports){ //node
module.exports = tim;
} else { //browser
//use string because of Google closure compiler ADVANCED_MODE
global['tim'] = tim;
}
}(this));
for a wrapper that would run on other CJS environments besides nodejs check second example of this gist.
right now library assumes the browser environment. it's better to create a wrapper that will avoid creating global variables if an AMD loader is detected and also if running on nodejs...
based on the current implementation it's actually easy to create a wrapper that would run on multiple environments:
for a wrapper that would run on other CJS environments besides nodejs check second example of this gist.