I am creating a file structure in an application where each directory contains an "index" file. This index file takes the name of my directory to improve readability. Ex:
foo
|--foo.js // <- index
|--bin.html
|--bar
| |--bar.js // <- index
|--bin.html
With this, the structure that will be used for a require()
when importing any file will always be something like
const foo = require('./foo/foo');
const bar = require('./foo/bar/bar');
I look for some way to create a file without the nomenclature, and that the NodeJS understands for the import, would be something like:
foo
|--.js // <- sem nome = arquivo da pasta
|--bin.html
So I could work with files similar to namespace's ...
Is there any way to do this with NodeJS?