Skip to content

Commit

Permalink
docs: add install / usage example to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
vladholubiev committed Sep 7, 2019
1 parent f06ef13 commit 18cb07b
Showing 1 changed file with 37 additions and 2 deletions.
39 changes: 37 additions & 2 deletions README.md
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)

0 comments on commit 18cb07b

Please sign in to comment.