Skip to content

Commit 18cb07b

Browse files
committed
docs: add install / usage example to readme
1 parent f06ef13 commit 18cb07b

File tree

1 file changed

+37
-2
lines changed

1 file changed

+37
-2
lines changed

README.md

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,37 @@
1-
# elasticsearch-local
2-
Run any version of ElasticSearch locally
1+
# elasticsearch-local [![CircleCI](https://circleci.com/gh/shelfio/elasticsearch-local/tree/master.svg?style=svg)](https://circleci.com/gh/shelfio/elasticsearch-local/tree/master) ![](https://img.shields.io/badge/code_style-prettier-ff69b4.svg) [![npm (scoped)](https://img.shields.io/npm/v/@shelf/elasticsearch-local.svg)](https://www.npmjs.com/package/@shelf/elasticsearch-local)
2+
3+
> Run any version of ElasticSearch locally
4+
5+
## Usage
6+
7+
### 0. Install
8+
9+
```
10+
$ yarn add @shelf/elasticsearch-local --dev
11+
```
12+
13+
### 1. Start Elasticsearch
14+
15+
```js
16+
import {start} from '@shelf/elasticsearch-local';
17+
18+
await start({
19+
esVersion: '7.3.0',
20+
port: 9000, // optional
21+
clusterName: 'test', // optional
22+
nodeName: 'test', // optional
23+
indexes: ['one', 'two'] // optional
24+
});
25+
```
26+
27+
### 2. Stop Elasticsearch
28+
29+
```js
30+
import {stop} from '@shelf/elasticsearch-local';
31+
32+
await stop();
33+
```
34+
35+
## License
36+
37+
MIT © [Shelf](https://shelf.io)

0 commit comments

Comments
 (0)