Now that we have a shared understanding of what modules are in the JavaScript ecosystem, we can take a look at what TypeScript offers.
Exploring TypeScript modules
Export and import syntax
As we have seen, since ES2015 was released, modules have been a part of the specification. Given that TypeScript is a superset of JavaScript, it, of course, supports them as well and uses the same keywords: export and import.
As with ESM, TypeScript modules have their own scope and thus they don't pollute the global scope. Unless you export a symbol, it remains internal to the module and is not visible to the outside world.
You'll certainly appreciate the similarity of this TypeScript example to the previous ESM one:
// my-utils...