lib/config.js
function saveToFile(filename, cfg) {
  // Use 'wx' flag to fails if filename exists
  fs.writeFileSync(filename, JSON.stringify(cfg, null, 2), {flag: 'wx'})
}
function saveToFile(filename, cfg) {
  // Use 'wx' flag to fails if filename exists
  fs.writeFileSync(filename, JSON.stringify(cfg, null, 2), {flag: 'wx'})
}
function saveToFile ( filename , cfg ) { // Use 'wx' flag to fails if filename exists fs . writeFileSync ( filename , JSON . stringify ( cfg , null , 2 ) , { flag : 'wx' } ) }
Save HTTP server configuration to JSON file.
@param {string} filename - The JSON filename.
@param {Object} cfg - The HTTP server configuration.
@throws Will throw an error if filename exists.
Save HTTP server configuration to JSON file .