How to handle magic strings in JS

Use a config.js file with the following code

module.exports = {
	events : {
		GREET : 'greet'
	}
}

Import config.js in your files and use


var config = require('config').events;

console.log(config.events.GREET)