// file A need export const val = 'test'; module.exports = val; // file B want import A const token = require('./exported_file'); /* * Codes */