Skip to content

Commit 21aa001

Browse files
committed
Add usage and npm version badge
1 parent f199f7d commit 21aa001

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

README.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# jsonpath-js
22

3-
[![Link Checker](https://github.com/ashphy/jsonpath-js/actions/workflows/lint.yml/badge.svg)](https://github.com/ashphy/jsonpath-js/actions/workflows/lint.yml)
43
![GitHub License](https://img.shields.io/github/license/ashphy/jsonpath-js)
4+
![NPM Version](https://img.shields.io/npm/v/jsonpath-js)
5+
[![Link Checker](https://github.com/ashphy/jsonpath-js/actions/workflows/lint.yml/badge.svg)](https://github.com/ashphy/jsonpath-js/actions/workflows/lint.yml)
56

67
An implementation of RFC 9535 [JSONPath](http://goessner.net/articles/JsonPath/)
78

@@ -11,11 +12,23 @@ An implementation of RFC 9535 [JSONPath](http://goessner.net/articles/JsonPath/)
1112

1213
## Install
1314

14-
TBD
15+
```
16+
npm install jsonpath-js
17+
```
1518

1619
## Usage
1720

18-
TBD
21+
```ts
22+
import { JSONPathJS } from "jsonpath-js";
23+
24+
const query = new JSONPathJS("$.users[*].name");
25+
const result = query.find({
26+
users: [{ name: "John Doe" }, { name: "Jane Doe" }],
27+
});
28+
29+
// [ 'John Doe', 'Jane Doe' ]
30+
console.log(result);
31+
```
1932

2033
## Development
2134

0 commit comments

Comments
 (0)