Config Example
An example of a simple config pattern.
- Create a file named
config.jswith the following code.
// config.js
let config = {};
// general config
config.appName = "Some App Name";
// github config
config.github = {};
config.github.username = "tingiris";
module.exports = config;
- Create a file named
app.jsthat usesconfig.jswith the following code.
const config = require('./config.js');
console.log(`My GitHub username is: ${config.github.username}. The app name is: ${config.appName}.`)