1.0.0 • Published 9 years ago

dot-access v1.0.0

Weekly downloads
15,555
License
-
Repository
github
Last release
9 years ago

dot-access

Access object properties using dot notation.

var dotAccess = require('dot-access');

var user = { 
  fullname: { 
    first: 'Joe', 
    last: 'M' 
  } 
};

// get
dotAccess.get(user, 'fullname.first'); // 'Joe'

// or set
dotAccess.set(user, 'fullname.last', 'T'); // 'T'

Installation

Install with component(1):

$ component install nthtran/dot-access

API

License

MIT