---
title: "Discussion on \"Comparison of JavaScript modules\" | Hashnode"
description: "Discussion on \"Comparison of JavaScript modules\". JavaScript has been around since 1995. In that time there have been several different ways to create modules. Due to browser compatibility issues and legacy codebases, all of these module types are still in use today.\nWhat is a module?\nA module is so..."
url: "https://hashnode.com/posts/comparison-of-javascript-modules/5fc41f4dbc24037614df82b2"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Comparison of JavaScript modules](https://joeattardi.dev/comparison-of-javascript-modules?utm_source=hashnode&utm_medium=feed)

JavaScript has been around since 1995. In that time there have been several different ways to create modules. Due to browser compatibility issues and legacy codebases, all of these module types are still in use today. What is a module? A module is so...

Nov 29, 2020 · 12 min read · joeattardi.dev  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#web-development](https://hashnode.com/tag/web-development)
-   [#javascript-modules](https://hashnode.com/tag/javascript-modules)

## Written by

[Joe Attardi](https://hashnode.com/@joeattardi)

@joeattardi · Boston Area, MA, USA

  
[View profile](https://hashnode.com/@joeattardi)

Veteran Software Developer | Web & Front-End Expert | Author | Tech Writer | Blogger

Software developer since 2004. Web/front-end expert (HTML, CSS, JS). O'Reilly and Apress author. Freelance tech writer. Blogger. Bridging code and communication in tech.

## Responses 1

Markdown supported · ⌘↵ to post

[shadowtime2000](https://hashnode.com/@shadowtime2000)

[Dec 2, 2020](https://hashnode.com/posts/comparison-of-javascript-modules/5fc41f4dbc24037614df82b2/comment/5fc721baa0a3250b19a58e4e)

Your ES modules examples weren't exactly ES modules. I believe in the actual specification you had to have `.js` extensions in imports and you can only import from URLs and relative paths. It was module bundlers which popularized the syntax you are using which is kind of the same as with NodeJS. If you are using a bundler you can import a library from it's name, if you aren't you have import it from an NPM CDN such as skypack.
