rget

Access your properties by string. Recursively!

npm install rget
6 downloads in the last week
87 downloads in the last month

rget

Copyright (C) 2011 by Maciej MaƂecki
MIT License (see LICENSE file)

Access your properties by string. Recursively!

Usage

var rget = require('rget');

var obj = {
  user: {
    name: 'Fred',
    preferences: {
      coffee: 'black'
    }
  }
};

rget(obj, 'user.preferences.coffee'); // => 'black'

//
// It also supports custom separators.
//
rget(obj, 'user:preferences:coffee', ':'); // => 'black'

Installation

npm install rget
npm loves you