News for hackers. Stuff that matters.
Re:JLua: Yet another Lua implementation in JavaScript by ianjsikes on Saturday May 25, 2019 @03:14PM (#20010702)
1. The "index.js" thing is due to how module resolution is handled with CommonJS and ES modules. If you have a file at "./lib/index.js", then you can omit the "index.js" and just write "require('./lib')" from another file.

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.

There are no comments on this comment yet.