setnested

0.0.4 • Public • Published

setnested

An easy way to get/set Javascript literals with path namespace

Why setnested

  • Lightweight (~1kB min&gzip)
  • Array support
  • Object support
  • Creates when doesn't exist
  • Returns/Change when exist
  • Fast
  • Easy

CDN

Installing

$ npm install setnested
# or
$ yarn add setnested

Using

// CommonJS / NodeJS
var nested = require('setnested');

// ES6
import { set, get } from 'setnested';

// Browser
// HTML Tag: <script src="https://unpkg.com/setnested"></script>
// Now you have access via `window.nested`

Usage

var yourObject = nested.set({'myAccess.to.property': true})
};

Methods

get

nested.get(yourObject, 'myAccess.to.property') // get value via string

set

nested.set(yourObject); // parsed object

License

Licensed under MIT-License, do everything, use it

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i setnested

    Weekly Downloads

    4

    Version

    0.0.4

    License

    MIT

    Unpacked Size

    7.96 kB

    Total Files

    5

    Last publish

    Collaborators

    • dalisoft