# is-cf

> Cloud Foundry environment detection and helpers.

Latest version **1.1.1** (published 2017-05-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install is-cf
pnpm add is-cf
yarn add is-cf
bun add is-cf
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2017-05-24 |
| First published | 2016-12-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Stu Radnidge |
| Maintainers | stu |

## Links

- npm: https://www.npmjs.com/package/is-cf
- Repository: https://github.com/sturadnidge/is-cf
- Issues: https://github.com/sturadnidge/is-cf/issues
- npm.io page: https://npm.io/package/is-cf

## Dependencies (1)

- [lodash](https://npm.io/package/lodash.md) ^4

## Recent versions

- 1.1.1 (latest) — 2017-05-24
- 1.1.0 — 2017-05-24
- 1.0.2 — 2017-01-06
- 1.0.1 — 2016-12-02
- 1.0.0 — 2016-12-02
- 0.0.1 — 2016-12-01

## README

is-cf
=====

Cloud Foundry environment detection and helpers.


# Installation
```bash
npm install --save is-cf
```

# Usage
```javascript
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

---
_Source: https://npm.io/package/is-cf · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
