Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pawsong/env-var-fp

Functional utility for parsing env variables
https://github.com/pawsong/env-var-fp

Last synced: about 5 hours ago
JSON representation

Functional utility for parsing env variables

Awesome Lists containing this project

README

        

# env-var-fp

Functional utility for parsing env variables

## Usage

```typescript
import { env, requires } from 'env-var-fp';
import { defaultTo } from 'lodash/fp';

// Throws exception
env(requires)('UNDEFINED_VAR')

// Returns 2
env(defaultTo('2'), parseFloat)('UNDEFINED_VAR')
```

## License

MIT