Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A small module that takes a dotpath string and returns the value of that path from the object, written as part of a tutorial on Javascript.
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
README.md
index.js
package.json
test.js

README.md

dotpathlookup

A small module that takes a dotpath string and returns the value of that path from the object, written as part of a tutorial on Javascript.

var parse = require('dotpathlookup');
var my_function = parse('check.it.out');
var obj = {check:{it:{out:"woop woop"}}};

console.log(my_function(obj));  // === "woop woop"

API

parse = require('dotpathlookup') -> function(str)

returns a function that accepts a string to split it into a manageable array.

parse(str) -> function(obj)

returns the value of the path, which should only be a string.

LICENSE

MIT

Something went wrong with that request. Please try again.