Skip to content

Commit 9ffced4

Browse files
authored
Merge pull request #8 from htnabe/feature/README
update README
2 parents da81f96 + 4dd82a0 commit 9ffced4

File tree

1 file changed

+44
-6
lines changed

1 file changed

+44
-6
lines changed

README.md

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
This is a command-line util to upload Algolia sources. This idea comes from [atomic-algolia](https://github.com/chrisdmacrae/atomic-algolia).
44

5+
## Install
6+
7+
```
8+
npm install -D algolia-uploader
9+
```
10+
11+
or
12+
13+
```
14+
yarn add -D algolia-uploader
15+
```
16+
517
## Example
618

719
1. Make `.env` file and set params
@@ -13,8 +25,23 @@ This is a command-line util to upload Algolia sources. This idea comes from [ato
1325
DATA_DIR=path/to/dir
1426
```
1527

28+
| | Description |
29+
| --------------------- | ------------------------------------------------------------------------------------- |
30+
| ALGOLIA_APP_ID | ID of the app indexed in Algolia |
31+
| ALGOLIA_ADMIN_API_KEY | API key that can update, delete and make indexes |
32+
| ALGOLIA_INDEX_NAME | Name of index set inn Algolia |
33+
| DATA_DIR | Relative path to the directory where the file you want to upload to Algolia is stored |
34+
35+
> [!IMPORTANT]
36+
> Do not include the file name in `DATA_DIR`.
37+
1638
2. Make `example.json` to be uploaded to Algolia
1739

40+
> [!CAUTION]
41+
>
42+
> - Currently only json file is supported.
43+
> - `objectID` key is necessary
44+
1845
```
1946
[
2047
{
@@ -50,21 +77,32 @@ This is a command-line util to upload Algolia sources. This idea comes from [ato
5077
]
5178
```
5279

53-
Cautions:
80+
3. Execute command
5481

55-
- `objectID` is necessary
56-
- For now, only one json file can be loaded, I will support multiple files(maybe)
82+
For example,
5783

58-
3. Run `npx algolia-uploader` (WIP)
84+
```
85+
npx algolia-uploader
86+
```
5987

60-
If this library is published, I will try to make it possible to do the following
88+
```
89+
npm run algolia-uploader
90+
```
6191

6292
```
63-
> npx algolia-uploader
93+
yarn algolia-uploader
94+
```
95+
96+
Then, the items will be uploaded.
6497

98+
```
6599
> Added 3 items
66100
> Updated 2 items
67101
> Deleted 3 items
102+
103+
or
104+
105+
> No updates needed. All objects are up to date.
68106
```
69107

70108
## Development

0 commit comments

Comments
 (0)