Solved shit-require or import for nodejs dev

no more

require(‘../../../../some/very/deep/module’)

just use module-alias

npm i --save module-alias

Add your custom configuration to your package.json

"_moduleAliases": {
"@root" : ".",
"@deep" : "src/some/very/deep/directory/or/file",
"utils" : "utils"
}

Then add the main file (entry file) of project

require('module-alias/register')

Or if you use VSCODE as IDE create jsconfig.json file for code snippet

{
"compilerOptions": {
"baseUrl": ".",
"module": "commonjs",
"paths": {
"lib/*": [
"./lib/*"
],
"utils/*": [
"./utils/*"
],
}
},
"exclude": [
"node_modules",
]
}

Done! now you can require as easy path

require('utils/api/client')

Thank you!