Skip to main content Skip to secondary navigation Accessibility Feedback

JavaScript Anywhere

Over the last few weeks, I’ve converted all of my open source scripts to a UMD pattern.

UMD, or Universal Module Definition, is a simple wrapper around your code that allows it to run both in a browser and on a server (and theoretically, other places, too). While not formally registered, I also added instructions on installing the scripts with NPM, Bower, and Component using the GitHub hook if any of those are your thing.

The boilerplate I use to start all of my scripts is available on GitHub if you want to give UMD a go yourself. Major kudos to Todd Motto for helping me get started.

If you liked this article, you might also like Ditching jQuery, my new beginner's guide to vanilla JavaScript. Buy it today and save 25%! →
  • More articles on...
  • Code

Have any questions or comments about this post? Email me at chris@gomakethings.com or contact me on Twitter at @ChrisFerdinandi.

Get the Weekly Digest