1.1.1 • Published 7 years ago

is-cf v1.1.1

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

is-cf

Cloud Foundry environment detection and helpers.

Installation

npm install --save is-cf

Usage

var isCF = require('is-cf');

if (isCF.env()) {
	// Running on a Cloud Foundry
  if (isCF.getService('p-redis')) {
    // Service 'p-redis' is bound, do stuff

  }
}

API

env()

Determines Cloud Foundry presence using environment variables, returns a boolean

getAppEnv()

Returns VCAP_APPLICATION environment variable as an object

getServicesEnv()

Returns VCAP_SERVICES environment variable as an object

getService(name)

Returns environment metadata for service 'name' as an array, or null if service 'name' not found

getServiceInstance(serviceName, instanceName)

Returns environment metadata for service instance 'name' as an object, or null if service instance 'name' not found

1.1.1

7 years ago

1.1.0

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.0.1

7 years ago