1.0.1 • Published 6 years ago

app-env v1.0.1

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

app-env

Tries to be environment variables in JS runtime, global variables really, just not on window or self object. Still be cautious, two packages using app-env, and one is dependency of another and both call env.set('url', someValue). It will change value of url for both of them, causing unexpected behaviour.

Usage

Install

$ npm i app-env

Use

import env from 'app-env';

API

env.set(key: string, value: any, [modifiable: boolean])

Sets a value for given key, can be prevented from further modification by setting modifiable to false, in which case another attempt will throw TypeError.

env.get(key: string)

Gets value of given key, same as env.KEY_NAME_HERE

1.0.1

6 years ago

0.0.2

10 years ago

0.0.1

10 years ago