1.0.1 • Published 9 years ago

find-data v1.0.1

Weekly downloads
2
License
BSD-3-Clause
Repository
github
Last release
9 years ago

find-data

This is useful when you are working with a poorly documented API and want to find out how it is storing a given piece of data.

Examples:

var a = {
	hello: {
		best: [
			"apple",
			"friend",
			"toad"
		],
		other: 2,
		nope: function(){

		}
	},
	is: "this",
	friend: {
		has: "options"
		including: {
			other: "friends"
		}
	}
};

console.log(JSON.stringify(find('friend', a), null, 2));

Outputs:

{
	hello: {
		best: [
			null,
			"friend",
			null
		],
	},
	friend: {
		including: {
			other: "friends"
		}
	}
};