2
2
3
3
This is a command-line util to upload Algolia sources. This idea comes from [ atomic-algolia] ( https://github.com/chrisdmacrae/atomic-algolia ) .
4
4
5
+ ## Install
6
+
7
+ ```
8
+ npm install -D algolia-uploader
9
+ ```
10
+
11
+ or
12
+
13
+ ```
14
+ yarn add -D algolia-uploader
15
+ ```
16
+
5
17
## Example
6
18
7
19
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
13
25
DATA_DIR=path/to/dir
14
26
```
15
27
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
+
16
38
2 . Make ` example.json ` to be uploaded to Algolia
17
39
40
+ > [ !CAUTION]
41
+ >
42
+ > - Currently only json file is supported.
43
+ > - ` objectID ` key is necessary
44
+
18
45
```
19
46
[
20
47
{
@@ -50,21 +77,32 @@ This is a command-line util to upload Algolia sources. This idea comes from [ato
50
77
]
51
78
```
52
79
53
- Cautions:
80
+ 3 . Execute command
54
81
55
- - ` objectID ` is necessary
56
- - For now, only one json file can be loaded, I will support multiple files(maybe)
82
+ For example,
57
83
58
- 3 . Run ` npx algolia-uploader ` (WIP)
84
+ ```
85
+ npx algolia-uploader
86
+ ```
59
87
60
- If this library is published, I will try to make it possible to do the following
88
+ ```
89
+ npm run algolia-uploader
90
+ ```
61
91
62
92
```
63
- > npx algolia-uploader
93
+ yarn algolia-uploader
94
+ ```
95
+
96
+ Then, the items will be uploaded.
64
97
98
+ ```
65
99
> Added 3 items
66
100
> Updated 2 items
67
101
> Deleted 3 items
102
+
103
+ or
104
+
105
+ > No updates needed. All objects are up to date.
68
106
```
69
107
70
108
## Development
0 commit comments