Skip to content

Instantly share code, notes, and snippets.

@AllGistsEqual
Created February 15, 2021 12:40
Show Gist options
  • Save AllGistsEqual/42e2b5e21c63f031c446459f93df6790 to your computer and use it in GitHub Desktop.
Save AllGistsEqual/42e2b5e21c63f031c446459f93df6790 to your computer and use it in GitHub Desktop.
// File: src/index.js
/* [BETA]
* Load the config file from the directory
*/
this.log.info(`Loading config...`)
try {
this.config = JSON.parse(fs.readFileSync(this.configFile))
} catch (err) {
this.log.error(`Error reading config: ${err.message}`)
this.log.error(
'Please fix the config error or delete config.json so it can be regenerated.',
)
throw err
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment