What is bad practice connection of modules in one file?

Just bad practice that the connection of the modules?
./modules.js
exports.modules = {
 my_module = require('./app/my_module.js'),
 fs = require('fs')
}


./app/index.js
const _ = require('../modules');
console.log(_.my_module.name_string)
_.fs.readDir('/', (e, r) => {
console.log(r)
})


Does it affect anything?
June 10th 19 at 14:40
2 answers
June 10th 19 at 14:42
Solution
Not affected, not bad, keep doing that with your modules files.
A simple example:

import app from './app'
import user from './user'

export default combineReducers({
app,
user
 form : formReducer
})


reducers import from './reducers'
However, with the library modules in this sense a little bit. - genevieve_Upton commented on June 10th 19 at 14:45
June 10th 19 at 14:44
no not bad
require has a built-in cache module connection

Find more questions by tags Express.jsNode.js