Modules in JavaScript confusion

View other answers to this thread
Start a personal dev blog on your domain for free and grow your readership.

3.4K+ developers have started their personal blogs on Hashnode in the last one month.

Write in Markdown · Publish articles on custom domain · Gain readership on day zero · Automatic GitHub backup and more

Matt Strom's photo

Unfortunately, modules (more precisely, CommonJS modules) are not natively available in the browser. You need to use another module systems such as RequireJS, SystemJS, Browserify, Webpack, or the Universal Module Definition (UMD) pattern to use modules in the browser.

Also unfortunately, those are not the easiest libraries to use.

Jason Knight's photo

The "not natively available in browsers" being just part of why I've had little reason to even touch them.

That and it seems like a crutch for people who can't organize their code properly.