Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

33 lines (23 sloc) 0.474 kb

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
Jump to Line
Something went wrong with that request. Please try again.