Skip to content

Instantly share code, notes, and snippets.

@bcherny
Created September 15, 2013 00:55
Show Gist options
  • Save bcherny/6567138 to your computer and use it in GitHub Desktop.
Save bcherny/6567138 to your computer and use it in GitHub Desktop.
CoffeeScript UMD
umd = (factory) ->
if typeof exports is 'object'
module.exports = factory()
else if typeof define is 'function' and define.amd
define([], factory)
else
@MODULE_NAME = factory()
umd
# module body goes here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment