stackerjs-utils
v1.1.3
Published
[![Travis](https://img.shields.io/travis/parpeoficial/stackerjs-utils.svg)](https://travis-ci.org/parpeoficial/stackerjs-utils) [![Codecov](https://codecov.io/gh/parpeoficial/stackerjs-utils/branch/master/graph/badge.svg)](https://codecov.io/gh/parpeofici
Downloads
7
Maintainers
Readme
Utils
Package of utilities that works nicely in and outside StackerJS
Usage
Config
import { Config } from 'stackerjs-utils';
Config.set('any.value', { name: 'stackerjs-utils' });
Config.set('any.type', 'Hello');
Config.get('any.value'); // { "name": "stackerjs" }
Config.get('any.type'); // Hello
.ENV file
When a .env is configured in project root like this:
DB_DRIVER=mysql
APP_NAME=stackerjs-utils
It can be accessed by Config as:
import { Config } from 'stackerjs-utils';
Config.get('db.driver'); // mysql
Config.get('DB_DRIVER'); // mysql