Hello I have recently moved from common js to ES6 and I have refractured everything besides my directory and subdirectory which I have my files that I render for my project. I can't seem to find anything online about subdirectories with ES6 which doesn't make a lot of sense to me, I can't be the only person that uses them.
this is what I am trying to refracture
//common.js
app.set('views', [path.join(__dirname, 'views'),
path.join(__dirname, 'views/cViews/')]);
//these are the only two solutions I have found
//ES6
import path from 'path';
import {fileURLToPath} from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
/////
const __filename = new URL('', import.meta.url).pathname;
const __dirname = new URL('.', import.meta.url).pathname;
the only problem with these two solutions is they don't go to the subdirectories, they only go to the directory.
Any help would be appreciated, a easy solution would be to just put everything in the main directory but I like to be organized or I get lost.