Is it secure to export variables from the main.js file?

I’ve been looking for a way to share/reference variables from my main.js to a router file. I came across this question and tried sharing the variable over the locals of the app, which did work, but it required to get the variable from the locals for each route. So I thought I might just export the variables I need and import them in the router file, which also works, but makes me worried that the variables are exposed.
It looks like this:

main.js

//imports
const APP = express();
const httpServer = createServer(APP);
export const io = new Server(httpServer);

// APP configuration

export const sessionStore = new MySQLStoreInstance(storeOptions);
...

router.js

import {io, sessionStore} from "../main.js";
...

Is it secure to share variables this way, or are they exposed in some way? If it’s not secure, how can I securely share variables between files?