stackerjs-utils

[![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

Showing:

Popularity

Downloads/wk

16

GitHub Stars

1

Maintenance

Last Commit

3yrs ago

Contributors

4

Package

Dependencies

2

License

Type Definitions

Built-In

Tree-Shakeable

No?

Categories

Readme

Travis Codecov Maintainability Dependencies npm

NPM

StackerJS

Utils

Package of utilities that works nicely in and outside StackerJS

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.env('db.driver'); // mysql
Config.env('DB_DRIVER'); // mysql

Factory

Permits access easily functions and classes.

Defining

// config/providers.js

module.exports = {
    factories: {
        "FactoryName": function FactoryName()
        {
            //Do something
        },
        "OtherFactory": {
            factory: function Factorial() { /* Do something */ },
            params: { 
                define: "default",
                params: "to",
                be: "accessed",
                by: "factory"
            }
        }
    }
}

Accessing

import { Factory } from "stackerjs-utils";

let otherFactory = Factory("OtherFactory");
otherFactory.define; // default
otherFactory.params; // to

let otherFactory = Factory.make("OtherFactory", { define: "any" });
otherFactory.define; // any
otherFactory.params; // to

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial