0.2.1 • Published 6 years ago

glance-json v0.2.1

Weekly downloads
53
License
ISC
Repository
github
Last release
6 years ago

Glance JSON

npm install glance-json

Example

import glanceJSON from 'glance-json';

let data = {
	contact: {
		firstName: "John",
		lastName: "Doe",
		phoneNumber: 555-555-555
	}
};

glanceJSON(data, "John > phoneNumber") // 555-555-555

Options

key

Perform an exact match search on keys

let data = {
	square: {
		backgroundColor: "blue",
		color: "red"
	}
};

glanceJSON(data, "color#key"); // red

value

Perform an exact match search on values

let data = {
	contacts: [{
		firstName: "John",
		lastName: "Doe",
		phoneNumber: 555-555-555
	},
    {
    	firstName: "Johnny",
       	lastName: "Doey",
       	phoneNumber: 555-555-555	
    }]
};

glanceJSON(data, "John#value > phoneNumber") // 555-555-555

key-contains

Perform a contains text search on keys

let data = {
	contact: {
		firstName: "John",
		lastName: "Doe",
		phoneNumber: 555-555-555
	}
};

glanceJSON(data, "first#key-contains > phoneNumber") // 555-555-555

value-contains

Perform a contains text search on values

let data = {
	contact: {
		firstName: "John",
		lastName: "Doe",
		phoneNumber: 555-555-555
	}
};

glanceJSON(data, "555#value-contains > firstName") // John
0.2.1

6 years ago

0.2.0

6 years ago

0.1.11

6 years ago

0.1.10

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago