Skip to content

Repository files navigation

access-deep

Safe access to the nested object's properties with ES6 Proxy object

Build StatusCoverage Statusdependency Statusdependency StatusdevDependency Status

Install

$ npm install access-deep

Usage

varaccessDeep=require('access-deep');varobj={};varaccessor=accessDeep(obj);accessor.foo.bar.baz='quux';// nested objects are automatically createdconsole.log(JSON.stringify(obj));// {"foo":{"bar":{"baz":"quux"}}}accessor.foo.list[2]=12;console.log(JSON.stringify(obj));// {"foo":{"bar":{"baz":"quux"},"list":[null,12]}}console.log(accessor.foo.list[2].$val);// 12

Compatibility

Node.js version 6 and higher

Browser support http://caniuse.com/#feat=proxy

Warning

This is only experiment, use it at your own risk

About

Safe access to the nested object's properties with ES6 Proxy object

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages