# platform-config

> Fetch and validate platform configurations more easily

Latest version **0.1.5** (published 2015-09-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install platform-config
pnpm add platform-config
yarn add platform-config
bun add platform-config
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.5 |
| Published | 2015-09-30 |
| First published | 2015-09-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| Author | JP Wesselink |
| Maintainers | jpwesselink |

## Links

- npm: https://www.npmjs.com/package/platform-config
- Repository: https://github.com/sytac/platform-config
- Issues: https://github.com/sytac/platform-config/issues
- npm.io page: https://npm.io/package/platform-config

## Dependencies (8)

- [yargs](https://npm.io/package/yargs.md) ^3.26.0
- [bulk-require](https://npm.io/package/bulk-require.md) ^0.2.1
- [lodash.merge](https://npm.io/package/lodash.merge.md) ^3.3.2
- [lodash.negate](https://npm.io/package/lodash.negate.md) ^3.0.1
- [lodash.isobject](https://npm.io/package/lodash.isobject.md) ^3.0.2
- [lodash.zipobject](https://npm.io/package/lodash.zipobject.md) ^3.0.0
- [resolver-revolver](https://npm.io/package/resolver-revolver.md) ^0.4.8
- [lodash.isundefined](https://npm.io/package/lodash.isundefined.md) ^3.0.1

## Recent versions

- 0.1.5 (latest) — 2015-09-30
- 0.1.3 — 2015-09-30
- 0.1.4 — 2015-09-30
- 0.1.2 — 2015-09-28
- 0.1.1 — 2015-09-28
- 0.1.0 — 2015-09-28

## README

# platform-config

## Description

Fetch and validate platform configurations more easily

## Installation

```zsh
$ npm install --save platform-config
```

*If you'd like to try these examples, please run `gulp prepare-examples` first*

```js
// ./examples/easy/index.js

'use strict';

var path = require('path');
var platformConfig = require('platform-config');

var platforms = platformConfig({
  targets: path.join(__dirname, 'targets')
});

var current = platforms.current();
console.log(current);

```

In `targets` are the following files:

```js
// ./examples/easy/targets/development.js

'use strict';

var config = {
  description: 'BY THE POWER OF DEVELOPMENT'
};

module.exports = config;

```
```js
// ./examples/easy/targets/production.js

'use strict';

var config = {
  description: 'BY THE POWER OF PRODUCTION'
};

module.exports = config;

```

```bash
$ node examples/easy
{ description: 'BY THE POWER OF DEVELOPMENT' }
```

```bash
$ node examples/easy --NODE_ENV production
{ description: 'BY THE POWER OF PRODUCTION' }
```

```bash
$ export NODE_ENV=production
$ node examples/easy
{ description: 'BY THE POWER OF PRODUCTION' }
```

You can test and unset `NODE_ENV` like so:

```bash
$ echo $NODE_ENV
production
$ unset NODE_ENV
$ echo NODE_ENV

```

## Running tests

```zsh
$ gulp test
```

Test reports are written to `./reports`.

## Contributing

-   Do pull requests.
-   Make sure there's tests and meaningful coverage.
-   Respect `./eslintrc`.
-   Issues should go in issues.

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