Get started with jsonpath CDN
MIT licensed
JSONPath is an expression language for querying and filtering JSON data.
Tags:- jsonpath
- dchester
- JSONPath
- json-path
- object
- traversal
- json
- path
- data structures
- popular
Stable version
Copied!
How to start using jsonpath CDN
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.cdnhub.io/jsonpath/1.1.1/jsonpath.min.js"></script>
<title>Get started with jsonpath CDN - cdnhub.io</title>
</head>
<body>
<script>
const jsonData = {
"employees": [
{ "firstName": "John", "lastName": "Doe" },
{ "firstName": "Anna", "lastName": "Smith" },
{ "firstName": "Peter", "lastName": "Jones" }
]
};
const jsonPathExpression = "$..firstName";
const result = jsonpath.query(jsonData, jsonPathExpression);
console.log(result); // Output: ["John", "Anna", "Peter"]
</script>
</body>
</html>
Copied!
Copied!