Run any version of ElasticSearch locally
$ yarn add @shelf/elasticsearch-local --dev
import {start} from '@shelf/elasticsearch-local';
await start({
esVersion: '8.2.2',
port: 9000, // optional
clusterName: 'test', // optional
nodeName: 'test', // optional
indexes: [
{
name: 'your-index',
// create index with options - https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html#indices-create-api-request-body
body: {
settings: {
number_of_shards: '1',
number_of_replicas: '1'
},
aliases: {
'some-acc-id': {}
},
mappings: {
"properties": {
"field1" : {"type" : "text"}
}
}
}
] // optional
});
import {stop} from '@shelf/elasticsearch-local';
stop();
$ git checkout master
$ yarn version
$ yarn publish
$ git push origin master --tags
MIT © Shelf