We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
i have the following code
const routersDir = path.resolve(path.join(__dirname, 'routers')) const getRouters = () => fs.readdirSync(routersDir).forEach(file => { if (path.extname(file) === '.js') { const filePath = path.join(routersDir, file); console.log("filePath", filePath) const router = require(filePath) console.log("router", router) } })
i want to load the module in a dir but i got error
const router = require(filePath) ^ Error: Cannot find module "."
The text was updated successfully, but these errors were encountered:
does this code work in the default node.js?
Sorry, something went wrong.
No branches or pull requests
i have the following code
i want to load the module in a dir
but i got error
The text was updated successfully, but these errors were encountered: