Skip to content

Commit e959962

Browse files
committed
docs: update readme
1 parent 546907a commit e959962

File tree

3 files changed

+27
-21
lines changed

3 files changed

+27
-21
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@
44

55
### [`@path-tree/collection`](packages/collection)
66

7+
[![npm version](https://badge.fury.io/js/%40path-tree%2Fcollection.svg)](https://badge.fury.io/js/%40path-tree%2Fcollection)
8+
79
Provides a hierarchy of directories and files from a one-dimensional array of objects, including.
810

911
### [`@path-tree/react`](packages/react)
1012

13+
[![npm version](https://badge.fury.io/js/%40path-tree%2Freact.svg)](https://badge.fury.io/js/%40path-tree%2Freact)
14+
1115
Provides components with a hierarchical structure.
1216

1317
[DEMO](https://codesandbox.io/s/react-path-tree-demo-khbxc)

packages/collection/README.md

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
# [@path-tree/collection](https://github.com/Himenon/path-tree/tree/master/packages/collection)
22

3+
[![npm version](https://badge.fury.io/js/%40path-tree%2Fcollection.svg)](https://badge.fury.io/js/%40path-tree%2Fcollection)
4+
35
## Usage
46

7+
### Install
8+
9+
```bash
10+
yarn add @path-tree/collection
11+
```
12+
13+
### Basic Usage
14+
515
```ts
616
import { collect } from "@path-tree/collection";
717

@@ -21,27 +31,12 @@ The results above are as follows.
2131

2232
```json
2333
{
24-
"nodes": [
25-
"dir:a",
26-
"dir:a/b",
27-
"dir:a/b/c",
28-
"file:a/b/c/index.js",
29-
"file:a/b/index.js"
30-
],
34+
"nodes": ["dir:a", "dir:a/b", "dir:a/b/c", "file:a/b/c/index.js", "file:a/b/index.js"],
3135
"edges": {
32-
"dir:.": [
33-
"dir:a"
34-
],
35-
"dir:a": [
36-
"dir:a/b"
37-
],
38-
"dir:a/b": [
39-
"dir:a/b/c",
40-
"file:a/b/index.js"
41-
],
42-
"dir:a/b/c": [
43-
"file:a/b/c/index.js"
44-
]
36+
"dir:.": ["dir:a"],
37+
"dir:a": ["dir:a/b"],
38+
"dir:a/b": ["dir:a/b/c", "file:a/b/index.js"],
39+
"dir:a/b/c": ["file:a/b/c/index.js"]
4540
},
4641
"data": {
4742
"dir:a": {
@@ -71,4 +66,3 @@ The results above are as follows.
7166
## LICENSE
7267

7368
`@path-tree/collection` is [MIT licensed](./LICENSE).
74-

packages/react/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
# [@path-tree/react](https://github.com/Himenon/path-tree/tree/master/packages/react)
22

3+
[![npm version](https://badge.fury.io/js/%40path-tree%2Freact.svg)](https://badge.fury.io/js/%40path-tree%2Freact)
4+
35
## Usage
46

57
[DEMO](https://codesandbox.io/s/react-path-tree-demo-khbxc)
68

9+
### Install
10+
11+
```bash
12+
yarn add @path-tree/react
13+
```
14+
715
### Basic Usage
816

917
```tsx

0 commit comments

Comments
 (0)