pcf-services-parser
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

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"
// };

Package Sidebar

Install

npm i pcf-services-parser

Weekly Downloads

1

Version

1.1.0

License

Unlicense

Unpacked Size

288 kB

Total Files

13

Last publish

Collaborators

  • austinmatherne