@@ -14,11 +14,18 @@ JSONPath, JSON Patch and JSON Pointer for JavaScript.
1414 <a href =" https://www.npmjs.com/package/json-p3 " >
1515 <img alt="NPM" src="https://img.shields.io/npm/v/json-p3?style=flat-square">
1616 </a >
17- <img alt =" npm type definitions " src =" https://img.shields.io/npm/types/json-p3 " >
17+ <img alt =" npm type definitions " src =" https://img.shields.io/npm/types/json-p3?style=flat-square " >
1818</p >
1919
2020---
2121
22+ ** Table of Contents**
23+
24+ - [ Install] ( #install )
25+ - [ JSONPath] ( #jsonpath )
26+ - [ JSON Pointer] ( #json-pointer )
27+ - [ JSON Patch] ( #json-patch )
28+
2229## Install
2330
2431### Node.js
@@ -73,7 +80,35 @@ console.log(nodes.values());
7380
7481### Browser
7582
76- TODO:
83+ Download and include JSON P3 in a script tag:
84+
85+ ``` html
86+ <script src =" path/to/json-p3.iife.min.js" ></script >
87+ <script >
88+ const data = {
89+ players: [{ name: " Sue" }, { name: " John" }, { name: " Sally" }],
90+ visitors: [{ name: " Brian" }, { name: " Roy" }],
91+ };
92+ const nodes = json_p3 .query (" $..name" );
93+ console .log (nodes .values ());
94+ // [ 'Sue', 'John', 'Sally', 'Brian', 'Roy' ]
95+ </script >
96+ ```
97+
98+ Or use a CDN:
99+
100+ ``` html
101+ <script src =" https://cdn.jsdelivr.net/npm/json-p3@0.1.0/dist/json-p3.iife.min.js" ></script >
102+ <script >
103+ const data = {
104+ players: [{ name: " Sue" }, { name: " John" }, { name: " Sally" }],
105+ visitors: [{ name: " Brian" }, { name: " Roy" }],
106+ };
107+ const nodes = json_p3 .query (" $..name" );
108+ console .log (nodes .values ());
109+ // [ 'Sue', 'John', 'Sally', 'Brian', 'Roy' ]
110+ </script >
111+ ```
77112
78113## JSONPath
79114
0 commit comments