xxxxxxxxxx
//in your constants.js
module.exports = Object.freeze({
MY_CONSTANT: 'some value',
ANOTHER_CONSTANT: 'another value'
});
//in your main code
const constants = require('./constants');
console.log(constants.MY_CONSTANT); // 'some value'