Simple library to parse Web.config file into Javascript object to retrieve some key/value parameters.
var WCParser = require('webconfig-parser');
var config = WCParser.parse();
The parse
function return a Javascript object with the following structure :
{
param1Key: param1Value,
param2Key: param2Value,
...
}
If the readConnectionStrings
option is set to true the Javascript object returned contains a connectionStrings
property which is an object.
The parse
function accept the following options:
url
: The absolute path to access the Web.config file. You need to include the filename (Default to ./../../Web.config relative from the module script)tagName
: The name of the tag containing the parameters (Default to add)keyAttrName
: The name of the attribute containing the parameter key (Default to key)valueAttrName
: The name of the attribute containing the parameter value (Default to value)readConnectionStrings
: A boolean indicate if you need to retrieve connectionStrings entries (Default to false)
View the LICENSE file