js-config-helper
TypeScript icon, indicating that this package has built-in type declarations

1.3.0 • Public • Published

Js Config Helper

Latest Version on NPM Software License

Really simple and lightweight Config helper compatible with dotnotation inspired by Laravel.

Install

You can install the package via yarn (or npm):

yarn add js-config-helper

// or

npm install js-config-helper

Usage

import {Config} from 'js-form-helper';

// Instantiate a form class with some values
const config = new Config({
    field1: 'value 1',
    field2: 'value 2',
    person: {
        first_name: 'John',
        last_name: 'Doe',
    },
});

config('field1') // return 'value1'

config.set('field2', 'bar')
config.get('field2') // return bar instead of value2

config.get('person.first_name') // return John

config.has('person.first_name') // return true

config.all() // return all options

Security

If you discover any security related issues, please contact Daniel Sum instead of using the issue tracker.

Credits

This package is a part of the UpToolkit

License

The MIT License (MIT). Please see License File for more information.

Treeware

This package is a https://treeware.org.

If you use it in production, then we kindly propose that you buy the world a tree to thank us for our work.

By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.

Package Sidebar

Install

npm i js-config-helper

Weekly Downloads

3

Version

1.3.0

License

MIT

Unpacked Size

6.28 kB

Total Files

7

Last publish

Collaborators

  • danielsum