1.1.0 • Published 5 years ago

pcf-services-parser v1.1.0

Weekly downloads
2
License
Unlicense
Repository
github
Last release
5 years ago

pcf-services-parser

npm node David Greenkeeper badge

Travis (.com) Code Climate maintainability Code Climate coverage

A parser for PCF service credentials

Returns PCF service credentials as an object of ENV formatted strings.

Given the service configuration:

{
  "VCAP_SERVICES": {
    "user-provided": [
      {
        "name": "db-service",
        "credentials": {
          "username": "db-username",
          "password": "db-password"
        }
      }
    ],
    "p-rabbitmq": [
      {
        "name": "message-broker",
        "credentials": {
          "username": "broker-username",
          "password": "broker-password"
        }
      }
    ]
  }
}
const serviceCredentials = getPcfServiceCredentials();
console.log(serviceCredentials);
// {
//   DB_SERVICE_USERNAME: "db-username",
//   DB_SERVICE_PASSWORD: "db-password",
//   MESSAGE_BROKER_USERNAME: "broker-username",
//   MESSAGE_BROKER_PASSWORD: "broker-password"
// };
1.1.0

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

1.0.3

5 years ago