1.0.17 • Published 3 years ago

application.env v1.0.17

Weekly downloads
65
License
Apache-2.0
Repository
github
Last release
3 years ago

application.env

Small utility to load environment configurations that works for both, node and the browser.

Usage

In most cases, all you need to do is invoke load function:

import { load } from 'application.env';

load().then((env) => console.log('Env ready', env));

The above will load application.env file and append it to global object (proccess.env for node and window.env for browser). load() takes an optional argument specifying custom path to the file (defaults to application.env).

For Node you also get sync option:

import { loadSync } from 'application.env/node';

const env = loadSync();
console.log(env === proccess.env); // true

Behind the scenes

  • Node: the file is loaded from your file system.
  • Browser: the file is fetched from the same server that's serving HTML & JS files.
1.0.17

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.2

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago