# elasticexport

> Node Js Elasticsearch export and import module

Latest version **1.2.1** (published 2019-04-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install elasticexport
pnpm add elasticexport
yarn add elasticexport
bun add elasticexport
```

Provides the command `elasticexport`.

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2019-04-30 |
| First published | 2019-04-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 37.6 KB |
| Known vulnerabilities | 0 (+24 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Oğuz Akpınar |
| Maintainers | oguz.akpinar |
| Keywords | elasticsearch, export, import, dump, json, mapping, settings |

## Links

- npm: https://www.npmjs.com/package/elasticexport
- Repository: https://github.com/oguzakpinar/elasticexport
- Homepage: https://github.com/oguzakpinar/elasticexport#readme
- Issues: https://github.com/oguzakpinar/elasticexport/issues
- npm.io page: https://npm.io/package/elasticexport

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) ^0.18.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.2.1 (latest) — 2019-04-30
- 1.1.1 — 2019-04-24
- 1.0.1 — 2019-04-18

## README

# ElasticSearch Dump Operations For version-6

Required Node.js for work.
```sh
$ npm install -g elasticexport
```

## Capabilities

### Export and Import Mapping Option Added
  if you add mapping option to your export and import command mapping and settings also export and import.

### Export Data
Options
  - -host http:// is not required host and port is required 
  - -path Output file for export operation .json extension is required
  - export is required to process as export mode 
  - -index is not required. If it is added export specific index otherwise export all indexes
  - -fileSize default 4MB. If written data more than 4MB next data wtire in different file. 
Example usage
```sh
    elasticexport export -host localhost:9200 -index test -path /Users/xxx/Desktop/test.json -fileSize 4096
```

### Import Data
Options
  - -host http:// is not required host and port is required 
  - -path Inpot file for export operation .json extension is required. If *path*`n`.json file exists program read sequentially
  - import is required to process as import mode 
  - -index is not required. If it is added import data to specific index otherwise if export data runs with `all` options import process with same indexes, otherwise error occured
Example usage
```sh
    elasticexport import -host localhost:9200 -index test_document -path /Users/xxx/Desktop/test.json 
```

### Clear Index
Options
  - -host http:// is not required host and port is required 
  - delete is required to process as import mode 
  - -index is cleared index name
Example usage
```sh
    elasticexport delete -host localhost:9200 -index test 
```

Also user import and delete both it works first delete given index than import all data in also given index
```sh
elasticexport delete import -host localhost:9200 -index test_document -path /Users/xxx/Desktop/test.json
```
## Module Usage
Node projects use these options as module. In type script 
```ts
import { exportData, importData, clearIndex } from 'elasticexport';
exportData({
    host: 'localhost:9200',
    path: '/Users/xxx/Desktop/test.json',
    index: 'test'
});
clearIndex({
    host: 'localhost:9200',
    index: 'test2'
});
importData({
    host: 'localhost:9200',
    path: '/Users/xxx/Desktop/test.json',
    index: 'test2'
});
```

---
_Source: https://npm.io/package/elasticexport · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
