Skip to main content 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.

🚀 I just relaunched my Vanilla JS Pocket Guides with new code examples and real projects to help tie everything you’ll learn together. Check it out.

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

Get Daily Developer Tips