|
|
|
|
|
by blondin
2574 days ago
|
|
that's some beautiful javascript code and great project structure here. got me thinking about a few things:
1. is the "index.js" in subfolders a nodejs thing?
2. does that turn subfolders into modules?
3. can you write and run that kind of javascript without nodejs? |
|
2. Not exactly. In JS, every file with an "import" or "export" statement somewhere is its own module.
3. You can write code like this for the browser. Most browsers support ES modules now. However, you do need a bundler tool like Webpack if your code depends on other node modules.