1.0.3 • Published 6 years ago

webconfig v1.0.3

Weekly downloads
79
License
MIT
Repository
github
Last release
6 years ago

webconfig

Get the application settings from a .NET application's web/app.config from your nodejs application.

Install

npm install webconfig --save

Usage

var webconfig = require("webconfig");

webconfig
.compile({
    // Specify all webconfigs that you want to compile
    sources: [
      __dirname + '/web.config',
      __dirname + '/prod.web.config',
    ],
    // Configure your own overrides/extend for applicationSettings
    applicationSettings: {
      "MyApplicationSetting": "MyValue"
    },
    // Configure your own overrides/extend for appSettings
    appSettings: {
      "MyAppSetting": "MyValue"
    }
})
.then(function(compiledWebConfig){
  console.log(compiledWebConfig)
});

The compiledWebConfig object looks like this:

{
    // Array of xml2js translations of each web.config
    sources: [{
        configuration: [...]
    }],
    // App settings
    appSettings: {
        'webpages:Version': '3.0.0.0',
        'webpages:Enabled': 'false',
        ClientValidationEnabled: 'true',
        UnobtrusiveJavaScriptEnabled: 'true',
        MyAppSetting: "MyValue"
    },
    // Application settings
    applicationSettings: {
        Host: 'fake.company.com',
        EmailSenderDisplayName: 'FakeName',
        EmailTemplatesDirectory: 'C:\\fakepath',
        BaseUrl: 'http://localhost:50640/fake/',
        EmailSenderAddress: 'fake@fake.com',
        MyApplicationSetting: "MyValue"
    }
}
1.0.3

6 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago