-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add install / usage example to readme
- Loading branch information
1 parent
f06ef13
commit 18cb07b
Showing
1 changed file
with
37 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,37 @@ | ||
# elasticsearch-local | ||
Run any version of ElasticSearch locally | ||
# 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) | ||
|
||
> Run any version of ElasticSearch locally | ||
## Usage | ||
|
||
### 0. Install | ||
|
||
``` | ||
$ yarn add @shelf/elasticsearch-local --dev | ||
``` | ||
|
||
### 1. Start Elasticsearch | ||
|
||
```js | ||
import {start} from '@shelf/elasticsearch-local'; | ||
|
||
await start({ | ||
esVersion: '7.3.0', | ||
port: 9000, // optional | ||
clusterName: 'test', // optional | ||
nodeName: 'test', // optional | ||
indexes: ['one', 'two'] // optional | ||
}); | ||
``` | ||
|
||
### 2. Stop Elasticsearch | ||
|
||
```js | ||
import {stop} from '@shelf/elasticsearch-local'; | ||
|
||
await stop(); | ||
``` | ||
|
||
## License | ||
|
||
MIT © [Shelf](https://shelf.io) |