pcf-services-parser
v1.1.0
Published
A parser for PCF service credentials
Downloads
19
Maintainers
Readme
pcf-services-parser
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"
// };