Document resin/config

This commit is contained in:
Juan Cruz Viotti 2014-12-05 13:58:23 -04:00
parent df12d5108d
commit 0c5126f0d5

View File

@ -1,8 +1,23 @@
fs = require('fs')
errors = require('../errors/errors')
# Read JSON configuration file
#
# @private
#
# User config loading should be sync, as we need to
# extend this module with the result before exporting
#
# @param {String} configFile configuration file path
# @return {Object} Parsed configuration file
#
# @throw {InvalidConfigFile} Will throw an error if file doesn't exist
# @throw {InvalidConfigFile} Will throw an error if file is not JSON
#
# @example Read config file
# contents = resin.config.loadUserConfig('/Users/me/resin-custom.json')
# console.log(contents.remoteUrl)
#
exports.loadUserConfig = (configFile) ->
return if not fs.existsSync(configFile)