0.0.4 • Published 6 years ago

setnested v0.0.4

Weekly downloads
2
License
MIT
Repository
-
Last release
6 years ago

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

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

7 years ago