# env-to-obj

> parse process.env to a deeply nested camelCase object

Latest version **1.0.0** (published 2017-03-01) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install env-to-obj
pnpm add env-to-obj
yarn add env-to-obj
bun add env-to-obj
```

## 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.0.0 |
| Published | 2017-03-01 |
| First published | 2017-03-01 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Mikey |
| Maintainers | ahdinosaur |

## Links

- npm: https://www.npmjs.com/package/env-to-obj
- Repository: https://github.com/ahdinosaur/env-to-obj
- Homepage: https://github.com/ahdinosaur/env-to-obj#readme
- Issues: https://github.com/ahdinosaur/env-to-obj/issues
- npm.io page: https://npm.io/package/env-to-obj

## Dependencies (2)

- [camelcase](https://npm.io/package/camelcase.md) ^4.0.0
- [libnested](https://npm.io/package/libnested.md) ^1.2.1

## Recent versions

- 1.0.0 (latest) — 2017-03-01

## README

# env-to-obj

parse `process.env` to a deeply nested camelCase object

```shell
npm install --save env-to-obj
```

## example

```shell
APP__THING=face APP__PORT=8000 APP__IS_CAT=true node -p "require('env-to-obj')(process.env)"
```

```
{
  ...
  app: {
    thing: 'face',
    port: 8000,
    isCat: true
  }
}
```

## usage

### `envToObj = require('env-to-obj')`

### `obj = envToObj(process.env)`

given `process.env` (or a similar object),

where "__" in a variable name indicates a nested property,

(e.g. `foo__bar__baz` => `foo.bar.baz`)

returns a deeply nested object where:

keys are converted to camelCase, and

values are coerced from strings into primitive types (`Number`, `Boolean`, `null`, `undefined`).

## license

The Apache License

Copyright &copy; 2017 Michael Williams

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

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