Skip to content

Commit c21a275

Browse files
(docs) improve readme
1 parent 13ac37c commit c21a275

File tree

2 files changed

+41
-4
lines changed

2 files changed

+41
-4
lines changed

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,40 @@
66

77
![alt text](docs/react-jsonpath-editor.png "React json path editor")
88

9+
## Usage
10+
11+
install the dependency using `npm` or `yarn`
12+
13+
```
14+
npm i --save react-jsonpath-editor
15+
```
16+
17+
18+
```
19+
yarn add react-jsonpath-editor
20+
```
21+
22+
```javascript
23+
import React, {Component} from 'react'
24+
import JsonPathEditor from 'react-jsonpath-editor';
25+
26+
class App extends Component {
27+
render() {
28+
return <div>
29+
<JsonPathEditor />
30+
</div>;
31+
}
32+
}
33+
```
34+
35+
## Properties
36+
37+
| Props | Type | Required | Description |
38+
|:-------------:|:-------------:|:---------:|-------------------------------------------------------|
39+
| inputProps | object | false | Properties passed down to the input |
40+
| value | string | false | input default value |
41+
| json | object | false | json to test the json path and provide autocompletion |
42+
| onChange | function | false | callback called when jsonPath changed |
943

1044
[build-badge]: https://img.shields.io/travis/JeanBaptisteWATENBERG/react-jsonpath-editor/master.png?style=flat-square
1145
[build]: https://travis-ci.org/JeanBaptisteWATENBERG/react-jsonpath-editor

package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,14 @@
3333
"react": "^16.4.0",
3434
"react-dom": "^16.4.0"
3535
},
36-
"author": "",
37-
"homepage": "",
36+
"author": "Jean-Baptiste WATENBERG",
37+
"homepage": "https://github.com/JeanBaptisteWATENBERG/react-jsonpath-editor",
3838
"license": "MIT",
39-
"repository": "",
39+
"repository": "https://github.com/JeanBaptisteWATENBERG/react-jsonpath-editor",
4040
"keywords": [
41-
"react-component"
41+
"react-component",
42+
"jsonpath",
43+
"react",
44+
"component"
4245
]
4346
}

0 commit comments

Comments
 (0)