Skip to content

Instantly share code, notes, and snippets.

@dmamills
Created February 5, 2014 23:40
Show Gist options
  • Save dmamills/8835676 to your computer and use it in GitHub Desktop.
Save dmamills/8835676 to your computer and use it in GitHub Desktop.
JS library exports for node/amd/browser
(function(root) {
function exportFunctions () {
if (typeof define === 'function' && define.amd) {
define(function () {
return functions;
});
} else if (typeof module !== 'undefined' && module !== null) {
module.exports = functions;
} else {
root.vagueTime = functions;
}
}
}).call(this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment