Get unlimited public & private packages + package-based permissions with npm Pro.Get started »

dot-access

1.0.0 • Public • Published

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

Keywords

none

Install

npm i dot-access

DownloadsWeekly Downloads

17,218

Version

1.0.0

License

none

Last publish

Collaborators

  • avatar